in reply to Re: regex question
in thread regex question
you also don't escape characters in a character class. your regex (once g is added for global) will strip back slash characters, as well as braces.No, it doesn't. There's no need to escape the parens, but it certainly doesn't do any harm:
No backslashes are removed.$_ = 'foo\bar(baz)'; print "Before: '$_'; "; s/[\(\)]//g; print "After: '$_'\n"; __END__ Before: 'foo\bar(baz)'; After: 'foo\barbaz'
|
|---|