Regexp parentheses fix

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