in reply to Re^6: about style: use possessive or atomic?
in thread about style: use possessive or atomic?
if the meaning of {n}+ hasn't be deprecated or changed its a totally wrong warning.
Please run my code with 5.20, with same results we should file a bug report.
As you can see there its not redundant.
The plus is neither a greedyness operator here, bc its in second place, its there to stop backtracking.
Like a greedy quantifier, a possessive quantifier repeats the token as many times as possible. Unlike a greedy quantifier, it does not give up matches as the engine backtracks. With a possessive quantifier, the deal is all or nothing. You can make a quantifier possessive by placing an extra + after it. * is greedy, *? is lazy, and *+ is possessive. ++, ?+ and {n,m}+ are all possessive as well.
so + is "greedy" and ++ "possessive", {n}+ is analogous to ++ .
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: about style: use possessive or atomic? (BUG!!!)
by LanX (Saint) on Aug 16, 2015 at 22:58 UTC | |
by rsFalse (Chaplain) on Aug 16, 2015 at 23:28 UTC | |
by LanX (Saint) on Aug 16, 2015 at 23:51 UTC | |
by LanX (Saint) on Jan 24, 2016 at 23:13 UTC |