in reply to Re: Failed regex: negative look-behinds
in thread Failed regex: negative look-behinds

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"

Which is exactly what I want to match, but the regex doesn't seem to match this any occurance of one or more alphanumeric at the end of a string that does not follow "compiled". *shrug*

  • Comment on Re^2: Failed regex: negative look-behinds

Replies are listed 'Best First'.
Re^3: Failed regex: negative look-behinds
by chargrill (Parson) on Feb 07, 2006 at 06:11 UTC

    I think they're right up above, most notably ikegami and graff...

    the entire OP regex is anchored at start-of-string, so there's no place to "look-behind"



    --chargrill
    $/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );