From '123456789'
I want to find all (overlapping) matches of 3 consecutive numbers
:
ListIWant = [123,234,345,456,567,678,789]
I tried:
print(re.compile(r"(\d){3}").findall('123456789'))
Output I currently get:
['3', '6', '9']
And also I want to know if there is something more efficient to count the number of matches instead of using len(ListIWant)
I'm learning English also, It will be grateful if you correct or suggest me better words/ways to express myself in this place.