Observed in Visual Studio Code 1.50.0.
A match operator will not be highlighted as regex if it uses / delimiters without the m prefix, is matching $_ implicitly, and is used in an assignment statement directly after the = (e.g. is not in parentheses).
Example code:
$_ = 'Hello world';
my ($match) = /Hello\s+(\S*)/;

One workaround is to use the m prefix:

Observed in Visual Studio Code 1.50.0.
A match operator will not be highlighted as regex if it uses
/delimiters without themprefix, is matching$_implicitly, and is used in an assignment statement directly after the=(e.g. is not in parentheses).Example code:
One workaround is to use the
mprefix: