Think about Loose Coupling | |
PerlMonks |
Re: Negating Regexes: Tips, Tools, And Tricks Of The Tradeby diotalevi (Canon) |
on Dec 07, 2006 at 16:24 UTC ( [id://588384]=note: print w/replies, xml ) | Need Help?? |
I'd prefer to use this instead of Sidhekin's because it lets your pattern start it's match normally and doesn't require retrying at ever offset. The following lets the pattern match however it normally would but fails when it succeeds. /(?(??{...})(?!))/;In Perl 5.10, this is especially nice [Updated: Oops. Forgot the (?:...|) to have a success branch] ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In Section
Seekers of Perl Wisdom
|
|