in reply to Matching quote characters?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching quote characters?
by betterworld (Curate) on Aug 05, 2006 at 19:22 UTC |