I have a string like:
s = 'ababbabbba'
I'm trying to match all patterns matching any number of b's between a's. This is what I expect the patterns to be for s
above:
['aba', 'abba', 'abbba']
This is what I've tried:
import re
re.findall('ab+a', s)
Which gives:
['aba', 'abbba']
I think that happens because any single a can only be part of a single group. Whereas my requirement would make the middle a's be part of two groups. Reading through the re
documentation, I can't find any way to do this.