Sublime Forum

[BUG] Perl syntax highlightning: missing option for regexp substitution

#1

For regexp substitution (s/this/that/[…]) Perl has an option flag ‘r’, non-desctructive substitution, which Sublime Text 3 build 3126 doesn’t recognize, causing syntax highlightning to break.

Example:

$trimmed = $input =~ s/^\s+|\s+$//gr;

(ps. how can I add this myself, until a fix is released?)

0 Likes

#2

Have you tried using the ModernPerl syntax package? It has improved syntax highlighting which seems to work for this case.

https://packagecontrol.io/packages/ModernPerl

0 Likes