Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Perl Complains of Nested Quantifiersby demerphq (Chancellor) |
on May 22, 2012 at 21:38 UTC ( [id://971886]=note: print w/replies, xml ) | Need Help?? |
Well, what this means is that a pattern like /foo(?:baz)++baz/ will never match. If you had a string like "foobazbazbaz" it would fail because (?:baz)++ will "gobble up" all of the "baz" in the string, and then refuse to give anything back. What it means by "does not disable backtracking" is that "foobazbazbaz foobazbazbaz" will *attempt* the /(?:baz)++/ twice, once after each "foo". Neither will match of course, and if the RE was _really_ smart it would know it could never match and wouldn't try at all, but it isn't. :-)
--- $world=~s/war/peace/g
In Section
Seekers of Perl Wisdom
|
|