Seems to do the trick, assuming record delimiters in STDIN are correctly set. Basically, the regexp matches anything that isn't a comment or a quote character, *or* anything that's a quote character followed by anything. Because perl is greedy, this matches up to the first unquoted comment character, and we just substitute away anything after that...while ($_ = <STDIN>) { chomp; s/^((([^\#\\])|(\\.))*)\#.*$/$1/; print "$_\n"; }
In reply to Re: quoting characters
by ahunter
in thread quoting characters
by WHolcomb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |