in reply to Failed regex: negative look-behinds
Thus spaketh the doc perlre
"(?<!pattern)" A zero-width negative look-behind assertion. For exa +mple "/(?<!bar)foo/" matches any occurrence of "foo" that +does not follow "bar". Works only for fixed-width look-behind +.
Therefore, /\A(?<!compiled)[a-zA-Z0-9]+\z/ matches any occurance of one or more alphanumeric at the end of a string that does not follow "compiled"
You might also have an issue with operator associativity and/or precedence... from perlop, orhas much lower precedence (and left associativity) than eq...
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Failed regex: negative look-behinds
by loikiolki (Novice) on Feb 07, 2006 at 06:04 UTC | |
by chargrill (Parson) on Feb 07, 2006 at 06:11 UTC |