I'm going to assume you're using something along the lines of s/".*"//gs; to do this. It would explain why your example text would be completely removed. One way to fix this would be to use the '?' character to indicate non-greediness: s/".*?"//gs;. A better way would be to use a negated character class. An example using this follows:
#!c:/perl/bin/perl -w $|++; use strict; my $txt = <<'TXT_DONE'; This is an "example", where all of the "quotes in this text" are removed, therefore cleansing the text of "all visible quotes". "So this quote", as well as "this quote here" will be stripped. TXT_DONE $txt =~ s/"[^"]+"//g; print $txt; __END__ This is an , where all of the are removed, therefore cleansing the text of . , as well as will be stripped.
In reply to Re: I just cannot figure out the greedy regex
by Coruscate
in thread I just cannot figure out the greedy regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |