petdance/vim-perl — Issue #73: Syntax highlighting of nested s/// expression
Author: karenetheridge
Created: 2012-03-06 16:56:43+00:00
State: open

This expression is not coloured correctly (as of today's HEAD):

$log =~ s{
(%d(?:{(.*?)})?)| # $1: datetime $2: datetime fmt
(?:%([%pmFLPn\$])) # $3: others
}{
if ($1 && $2) {
my $dt_fmt = $2;
my $now = ($dt_fmt =~ /\%[369]?N/)
? (Time::HiRes::time)
: time;
DateTime->from_epoch(epoch=>$now)->strftime($dt_fmt);
}
elsif ($1) {
scalar localtime;
}
elsif ($3) {
$p{$3};
}
}egx;

The colouring starts to go wrong at the } in line 2, as marked here:
(%d(?:{(.*?)})?)|
^