|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Re: RE: Quantifiers in regular expressionsby Roy Johnson (Monsignor) |
| on May 19, 2004 at 16:25 UTC ( [id://354742]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Putting a ? on a quantifier that isn't variable-length is like having any color car you want, as long as it's black. There's no difference between a greedy and a non-greedy {5}.
A greedy quantifier will take as many characters as it can, and then start backtracking until whatever follows it matches. A non-greedy one will take as few characters as it can, and then take more until whatever is supposed to follow it is found. The PerlMonk tr/// Advocate
In Section
Tutorials
|
|
||||||||||||||||||||||||