Skip to content

Match operator not highlighted when used in assignment #44

@chrstphrchvz

Description

@chrstphrchvz

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*)/;

image

One workaround is to use the m prefix:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions