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 martin.panter
Recipients ezio.melotti, martin.panter, mrabarnett, r.david.murray, terry.reedy
Date 2016-08-20.01:18:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471655908.57.0.577348618635.issue27800@psf.upfronthosting.co.za>
In-reply-to
Content
Okay so it sounds like my usage is valid if I add the brackets. I will try to come up with a documentation patch as some stage. The reason why it is not supported without brackets is to maintain a bit of consistency with the question mark (?), which modifies the preceding quantifier, and with the plus sign (+), which is also a modifier in other implementations.

For the record, Gnu grep does seem to accept my expression (although Posix says this is undefined, and neither support lazy or possessive quantifiers):

$ grep -E -o 'a{2}*' <<< "aaaaa"
aaaa

However pcregrep, which supports lazy (?) and possessive (+) quantifiers, doesn’t like my expression:

$ pcregrep -o 'a{2}*' <<< "aaaaa"
pcregrep: Error in command-line regex at offset 4: nothing to repeat
[Exit 2]
$ pcregrep -o '(?:a{2})*' <<< "aaaaa"
aaaa
History
Date User Action Args
2016-08-20 01:18:28martin.pantersetrecipients: + martin.panter, terry.reedy, ezio.melotti, mrabarnett, r.david.murray
2016-08-20 01:18:28martin.pantersetmessageid: <1471655908.57.0.577348618635.issue27800@psf.upfronthosting.co.za>
2016-08-20 01:18:28martin.panterlinkissue27800 messages
2016-08-20 01:18:28martin.pantercreate