I want to parse a string via RegEx (in real world my example is much more complex, else I would use split
)
This:
import re
regex="([a-z])(?:,([a-z]))*$"
p=re.compile(regex)
print(p.findall("a,b,c,d,e"))
Outputs:
[('a', 'e')]
But I would expect:
['a','b','c','d','e']
As I did group up the [a-z] sequences.
How can I get this desired behaviour?