|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^3: Quick Regex Questionby Athanasius (Vicar) |
| on Oct 08, 2012 at 14:37 UTC ( #997825=note: print w/ replies, xml ) | Need Help?? |
|
OK, change the regex to:
which should match only exactly 7 digits. (INC followed by 7 digits followed by either a non-digit or the end of the string.) Update: Better solutions:
using a zero-width negative look-ahead assertion; or:
using a zero-width positive look-ahead assertion together with \D as per GrandFather’s suggestion. See Extended Patterns. Athanasius <°(((>< contra mundum
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||