Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear Monks, I'm parsing a configuration file, so before doing the proecssing, I want to remove comments, which I take for granted are in the same style as Perl (i.e. one line comments starting with '#' which can occur after other text, which must be left intact) Here is my code. It works fine unless it comes across '[]' in a comment in my config file (it works fine if the '[]' is outside a comment), when it throws this:
I'm a bit new with regexes so chances are I've missed something obvious---any ideas? thanks!Those are my principles. If you don't like them I have others. -- Groucho Marx ....... In reply to Regex error when [] occurs in file.. by why_bird
|
|