Currently, BC3 doesn't highlight as strings regexps and quoted strings like these:
Also, the pattern for matching a Perl match needs to ignore a backslash that might escape the '/'. The rules below are not perfect but it's the most I could do with the PCRE subset. Any chance for extended regexps? Negative look-behind and that sort of stuff. Note that using simply
to take care of a potential backslash escaping an open regex delimiter '/', interferes with this rule:
because apparently the backslash rule is interpreted before the String=Text from ' to ' rule:
will be incorrectly highlighted because the character before a / is an apostrophe. Question to the developers: are the rules in the Grammar parsed in the order they show up there?
Anyway, here are the improved Perl String grammar rules. Just cut and paste in place of the two lines that come by default.
s|foo|bar|;
s#foo#bar#;
s{foo}{bar};
s(foo)(bar);
s[foo][bar];
print qw{a b};
print qw[c d];
print qw{e f};
print qq(g h);
print qq[i j];
print qq{k l};
print q(m n);
print q[o p];
print q{q r};
s#foo#bar#;
s{foo}{bar};
s(foo)(bar);
s[foo][bar];
print qw{a b};
print qw[c d];
print qw{e f};
print qq(g h);
print qq[i j];
print qq{k l};
print q(m n);
print q[o p];
print q{q r};
[^\\]/[^/]*/
String=Text from ' to '
my $path = '/'.$web.'/'.$topic;
Anyway, here are the improved Perl String grammar rules. Just cut and paste in place of the two lines that come by default.
(s|tr)/([^/]*/){2}
(s|tr)\|([^|]*\|){2}
(s|tr)#([^#]*#){2}
(s|tr)\(([^)]*\)){2}
(s|tr)\[([^\]]*\]){2}
(s|tr)\{([^}]*\}){2}
(q|qq|qw)\([^)]+\)
(q|qq|qw)\[[^\]]+]
(q|qq|qw)\{[^}]+}
(s|tr)\|([^|]*\|){2}
(s|tr)#([^#]*#){2}
(s|tr)\(([^)]*\)){2}
(s|tr)\[([^\]]*\]){2}
(s|tr)\{([^}]*\}){2}
(q|qq|qw)\([^)]+\)
(q|qq|qw)\[[^\]]+]
(q|qq|qw)\{[^}]+}
Comment