in reply to (tye)Re: Smart Search and Replacement with RegEx
in thread Smart Search and Replacement with RegEx

Here's another approach:
$line= <<END; 10 PRINT "<29>This is dim.<30>EThis is reversed.<28>This is bold.<27>" END my %fix= ( "<29>" => '@(-38)', "<28>" => '@(-40)', "<27>" => '@(-35)' ); my $pattern = join("|", map "(?:$_)", keys %fix); 1 while $line =~ s/("[^"]*) ($pattern) (.*?")/$1";$fix{$2};"$3/gx; $line =~ s/"";//g; $line =~ s/;""//g; print $line;