diff --git a/mode/perl.py b/mode/perl.py index 0d733d3..734d967 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -153,7 +153,7 @@ class PerlGrammar(Grammar): RegionRule(r'quoted', r'q[rqx] *(?P<)', QuotedGrammar3, r'>'), RegionRule(r'quoted', r'q[rqx] *(?P\[)', QuotedGrammar4, r'\]'), RegionRule(r'quoted', r"q[rqx] *(?P')", Grammar, r"'"), - RegionRule(r'quoted', r'q[rqx] *(?P[^ #])', StringGrammar, r'%(delim)s'), + RegionRule(r'quoted', r'q[rqx] *(?P[^ a-zA-Z0-9#])', StringGrammar, r'%(delim)s'), RegionRule(r'quoted', r'q[rqx](?P#)', StringGrammar, r'#'), # quote operator: q() and qw() do not interpolate @@ -162,7 +162,7 @@ class PerlGrammar(Grammar): RegionRule(r'quoted', r'qw? *<', Grammar, r'>'), RegionRule(r'quoted', r'qw? *\[', Grammar, r'\]'), RegionRule(r'quoted', r'qw?#', Grammar, r'#'), - RegionRule(r'quoted', r'qw? *(?P[^ #])', Grammar, r'%(delim)s'), + RegionRule(r'quoted', r'qw? *(?P[^ a-zA-Z0-9#])', Grammar, r'%(delim)s'), PatternRule(r'perl_function', r"(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*(?= *\()"), PatternRule(r'perl_namespace', r"(?:[a-zA-Z_][a-zA-Z_0-9]*\:\:)+(?:[a-zA-Z_][a-zA-Z_0-9]*)?"),