in reply to Help with Double Double Quotes regular expression

Two steps is the magic:

use strict; use warnings; while (<DATA>) { chomp; print "$_: "; s/"(.*)"/$1/g; s/""/"/g; print ">$_<\n"; } __DATA__ "" """" "a""""" "a""b""c""d""f"

Prints:

"": >< """": >"< "a""""": >a""< "a""b""c""d""f": >a"b"c"d"f<

Note that this fails if there is more than one quoted string in the string being processed.


DWIM is Perl's answer to Gödel