petdance has asked for the wisdom of the Perl Monks concerning the following question:
I understand how possessive quantifiers work, but I'm stuck thinking of a real example of when one would want to use them. perlre and perlreref have none.
Have you used possessive quantifiers in your code? Why? Please show a sample regex and explain why it needed them.
Edit: Besides quoted strings as mentioned below, do you have any real-world examples of needing to use a possessive quantifier?
xoxo,
Andy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: When would I want to use possessive quantifiers?
by ikegami (Patriarch) on Jul 07, 2010 at 17:34 UTC | |
|
Re: When would I want to use possessive quantifiers?
by Limbic~Region (Chancellor) on Jul 07, 2010 at 17:17 UTC | |
by JavaFan (Canon) on Jul 07, 2010 at 17:36 UTC | |
|
Re: When would I want to use possessive quantifiers?
by AnomalousMonk (Archbishop) on Jul 07, 2010 at 21:07 UTC | |
|
Re: When would I want to use possessive quantifiers?
by moritz (Cardinal) on Jul 08, 2010 at 06:29 UTC |