in reply to Regex help/ Lua parse
You could save yourself one match by replacing
withif ($line =~ m/^\s*terminal\s=\s"([^"]+)"\s*$/) { $line =~ s/$1/$change/; }
$line =~ s/^(\s*terminal\s=\s")([^"]+)("\s*)$/$1$change$3/;
In Section
Seekers of Perl Wisdom