You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perl's regex operators can use any pair of matching characters as delimiters (see https://perldoc.perl.org/perlop#Regexp-Quote-Like-Operators). When using a bracketing character as the delimiter, e.g. ({[, then the matching closing bracket can be used to close the operator, e.g. m<foo> or s{foo}{bar}. The bug only occurs when using the substitution operator (s///), and only when using bracketing delimiters, and only with a statement modifier (a trailing if, while, etc).
s/foo/bar/; # OKs/foo/bar/unless$baz; # OKs/foo/bar/if$baz; # OKs{foo}{bar}; # OKs{foo}{bar} if $baz; # BROKEN# lasts until a scalar variable is given; neither an @array nor a %hash works,# but the $scalar does (but the remainder of the line is still FUBAR)
# next line is OK, thoughs(foo)(bar) if $baz; # BROKEN - $clear;
s[foo][bar] if $baz; # BROKEN - $clear;
s<foo><bar> if $baz; # BROKEN - $clear;
s:foo:bar:if$baz; # OKs#foo#bar#if$baz; # OK# other statement modifierss(foo)(bar) for$baz; # BROKEN differentlys(foo)(bar) foreach $baz; # BROKEN - $clears(foo)(bar)unless$baz; # OKs(foo)(bar) until$baz; # BROKEN differentlys(foo)(bar) when$baz; # BROKEN differentlys(foo)(bar) while$baz; # BROKEN differently# other regex/quote-like operators are OK:m/foo/if$baz; # OKm{foo}if$baz; # OKq/foo/if$baz; # OKq{foo}if$baz; # OKqq/foo/if$baz; # OKqq{foo}if$baz; # OKqw/foo/if$baz; # OKqw{foo}if$baz; # OK
The text was updated successfully, but these errors were encountered:
Originally from @NorthboundTrain in microsoft/vscode#131322
Issue Type: Bug
Perl's regex operators can use any pair of matching characters as delimiters (see https://perldoc.perl.org/perlop#Regexp-Quote-Like-Operators). When using a bracketing character as the delimiter, e.g.
({[
, then the matching closing bracket can be used to close the operator, e.g.m<foo>
ors{foo}{bar}
. The bug only occurs when using the substitution operator (s///
), and only when using bracketing delimiters, and only with a statement modifier (a trailingif
,while
, etc).The text was updated successfully, but these errors were encountered: