Hi
I'd like to know why the output is only ['a'], instead of ['a', 'b', 'a'].
I thought that the presence of "|" would mach either a or b.
The presence of "+" is 1 or more, so I thought that it would attempt to match
all of "aba" as a result.
I'd like to know why the output is only ['a'], instead of ['a', 'b', 'a'].
I thought that the presence of "|" would mach either a or b.
The presence of "+" is 1 or more, so I thought that it would attempt to match
all of "aba" as a result.
>>> import re >>> re.findall(r'(a|b)+', 'aba') ['a']Am using 3.6.5.