This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Renji
Recipients Renji, ezio.melotti, mrabarnett
Date 2021-01-09.01:25:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org>
In-reply-to
Content
I can compile "((a)|b\2)*" expression and this expression successfully return captures from first repetition and second repetition in one time. But if I write (b\2|(a))* expression, I get "invalid group reference 2 at position 3" error. Either first or second behavior incorrect.
python3 --version Python 3.7.3

import re
text="aba"
#match=re.search(r"(b\2|(a))*",text) - not worked
match=re.search(r"((a)|b\2)*",text)
if(match):
    #show aba ba a
    print(match.group(0)+" "+match.group(1)+" "+match.group(2))
History
Date User Action Args
2021-01-09 01:25:31Renjisetrecipients: + Renji, ezio.melotti, mrabarnett
2021-01-09 01:25:30Renjisetmessageid: <1610155530.98.0.643940594728.issue42871@roundup.psfhosted.org>
2021-01-09 01:25:30Renjilinkissue42871 messages
2021-01-09 01:25:30Renjicreate