First, do you realize (??{ print $^N }) is causing the regexp to try to match "1", the return value of print? You should probably use something that's guaranteed not to match like (??{ print("$^N\n"); '(?!)' })or something that's guaranteed to match like (??{ print("$^N\n"); '(?=)' })
Or if you are only using the contents of the code block for it's side effects, use (?{ ... }) which always succeeds and otherwise has no effect upon the matching process. From perlre
This zero-width assertion evaluates any embedded Perl code. It always succeeds, and its code is not interpolated.
In reply to Re^2: Regular Expression Constructs ?<= and ?=
by BrowserUk
in thread Regular Expression Constructs ?<= and ?=
by eibwen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |