To replicate: my ($match) = / \s* (match_me) /x; my $syntax_coloration_broken = 'from here down'; What appears to be happening is that the \s* is interpretted as a substitution, e.g. s*search*replace*; Suggestions on fixing thing? Thanks, Joshua