Quote:
Originally Posted by hobnail
So why did my extra parentheses screw it up?
I added the parentheses so that it was clear, to me at least, what the OR was for.
|
In regex, parentheses are special characters. That's why you end up needing to escape a literal parenthesis with a \, (text) is capturing parentheses unless you start the text inside the parentheses with a ?: i.e. (?:text) for non-capturing parentheses. I seem to remember a 4th variety of parentheses but not sure about what flavour of regex that was in.
Basically, you can't use them as separators as you would in a mathematical expression.