Don't ask to ask, just ask | |
PerlMonks |
Re: Programmatically forcing a regexp to failby mwah (Hermit) |
on Oct 31, 2007 at 20:56 UTC ( [id://648361]=note: print w/replies, xml ) | Need Help?? |
that you could force a failure of the regexp It's probably the 'empty negative lookahead' (?!) :
This is documented eg. in Jeff Pinyan's work (also here on perlmonks). Correction 1: Added bounds "^ $" to \d+ to prevent backtracking in the above example. Correction 2: backtracking can be prevented by the atomic group (?>...):
Regards mwa
In Section
Seekers of Perl Wisdom
|
|