in reply to quoting characters
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: quoting characters
by Anonymous Monk on Apr 14, 2000 at 23:37 UTC |