But the .*? always gobbles up the trailing " and the \"? never matches it. I thought non-gready .* matched as few non-newline characters as possible. Why is it matching the final " if it could leave it for "? and the pattern would still match?my $string = '"foo"'; $string =~ s/\"(.*?)\"?/$1/; print $string;
In reply to Matching quote characters? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |