There is a special form of this construct (look-behind), called "\K" (available since Perl 5.10.0), which causes the regex engine to "keep" everything it had matched prior to the "\K" and not include it in $& ($MATCH). This effectively provides variable-length look-behind. The use of "\K" inside of another look-around assertion is allowed, but the behaviour is currently not well defined.
In Perl v5.18 and earlier, it (${^MATCH}) is only guaranteed to return a defined value when the pattern was compiled or executed with the "/p" modifier. In Perl v5.20, the "/p" modifier does nothing, so "${^MATCH}" does the same thing as $MATCH.The OP is using 5.010.
In reply to Re: Question on Regular Expression
by Anonymous Monk
in thread Question on Regular Expression
by sjain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |