I think in the $string =~ s/\"(.*?)\"?/$1/; version both the .*? and the \"? aremy $string = '"foo"'; my $string2 = '"foo'; $string =~ s/\"(.*?)\"|\"(.*?)/$1$2/; $string2 =~ s/\"(.*?)\"|\"(.*?)/$1$2/; print "$string -- $string2\n";
Updated:Corrected my muddle-headedness about "non-greedy ", thanks to betterwold.
In reply to Re: Matching quote characters?
by rodion
in thread Matching quote characters?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |