I recommend to use ${^MATCH}.
Always use the /p regex modifier when using ${^MATCH} and friends. The use of ${^MATCH} may appear to work without the /p modifier, but this is only fortuitous.
Quoth perlvar (emphasis added):
${^MATCH}This is similar to $& ($MATCH) except that it does not incur the performance penalty associated with that variable, and is only guaranteed to return a defined value when the pattern was compiled or executed with the "/p" modifier.
In reply to Re^2: Regex: Extracting the case insensitive string and printing on the output
by AnomalousMonk
in thread Regex: Extracting the case insensitive string and printing on the output
by rockstar99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |