Message273178
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 |
|
Date |
User |
Action |
Args |
2016-08-20 01:18:28 | martin.panter | set | recipients:
+ martin.panter, terry.reedy, ezio.melotti, mrabarnett, r.david.murray |
2016-08-20 01:18:28 | martin.panter | set | messageid: <1471655908.57.0.577348618635.issue27800@psf.upfronthosting.co.za> |
2016-08-20 01:18:28 | martin.panter | link | issue27800 messages |
2016-08-20 01:18:28 | martin.panter | create | |
|