I have a string, s="abaaaababbb".
I am using findall method and I want to know all the occurrences of (ab)+
.
The code that I am using is:
import re
s = "abaaaababbb"
x = re.findall("[ab]+",s)
print(x)
Output:
['abaaaababbb']
Instead I wanted output like:
['ab' , 'abab']
How to write the correct regular expression for the same?