Syntactic Confectionery Delight | |
PerlMonks |
Re: Another RegExp questionby davis (Vicar) |
on Aug 17, 2006 at 11:20 UTC ( [id://567888]=note: print w/replies, xml ) | Need Help?? |
The regex /\d{3}/ matches 3 digits anywhere in the string. If you want to restrict it to only 3 digits, you'd need to anchor it (specify either (both in this case) "start of the string" and the "end of the string" — these are logical atomic units):
Update: YAPE::Regex::Explain gives the following explanation:
davis
Kids, you tried your hardest, and you failed miserably. The lesson is: Never try.
Edited: Fixed slightly mixed tense.
In Section
Seekers of Perl Wisdom
|
|