Hiya,
The _getCompoundedRegex in inc/parser/lexer.php that merges regexps from different sources into one is not correct in its escaping of parenthesis.
It is meant to escape the "(" and ")" that are not part of a (?x...) one.
However, it fails to do so in cases like:
(?:a|(?:b|c))
which it turns into
(?:a|(?:b|c)\)
or
(?:[^)]) -> (?:[^)]\)
(?:\)) -> (?:\)\)
[(] -> [\(]
I attach a patch that does the escaping using another approach.