I'm trying to do a regex pattern to match all groups of A.. in a string until the next A. (Python)
For example: DFDAXDJSDSJDAFGCJASDJASAGXCJAD into:
'AXDJSDSJD'
'AFGCJ'
'ASDJ'
'AS'
'AGXCJ'
'AD'
The closest thing I came up with was:
string="DFDAXDJSDSJDAFGCJASDJASAGXCJAD"
r=re.compile('(A.[!=A]*)+')
matchObj = r.findall(string, re.M|re.I)
which returns AF, AS, ASA, AD
Why does it skip the first one? Why doesn't it return all chars until the next A?