To get this to compile I had to add additional backslashes to escape
the ‘#’ character in the negative lookahead subexpressions:
/([^*#]+|#(?!#|*)|*(?!#))+/x
The ‘#’ character normally matches itself in a regular expression.
With the “x” option I expect it to have a special meaning (indicating
a comment) but in one special position (immediately after the opening
brace and question mark):
(?# comment )
Is this a bug in the regular expression engine, undocumented or am I
missing something?
No big deal, the thing is compiling, but I’d like to understand this a
bit better.