Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Regex error when [] occurs in file..by why_bird (Pilgrim) |
on Mar 03, 2008 at 15:32 UTC ( [id://671663]=perlquestion: print w/replies, xml ) | Need Help?? |
why_bird has asked for the wisdom of the Perl Monks concerning the following question: 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 .......
Back to
Seekers of Perl Wisdom
|
|