Regexp parenthesis fix

Fix for parsing regular expressions like `/erroneous )regex/` or `/erroneous (regex/`.
Now the exceptions are properly raised.