Hi !
What works
- Setting a single option:
a(?i)b
- Unsetting a single option:
a(?-i)b
All the above work only for the i, m, s and x options.
What doesn't work:
- Setting / unsetting the
U, X, and J options
- Setting several options:
a(?im)b
- Unsetting several options:
a(?-i-m)b
- Mixing the above two:
a(?i-m)b
- Setting options for a non-capturing group:
a(?i:b)c
- The grammar allows the
(?+i) syntax, but according to the documentation and the PHP implementation this is invalid.
All the above fail with: Unexpected token "?" (zero_or_one) at line 1 and column 3
Possible fixes
Changing the grammar to:
// Internal options.
%token internal_option \(\?(-?[imsxJUX])+\)
solves n° 1, 2, 3, 4 & 6.
n° 5 is a bit more complex... 😉
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hi !
What works
a(?i)ba(?-i)bAll the above work only for the
i,m,sandxoptions.What doesn't work:
U,X, andJoptionsa(?im)ba(?-i-m)ba(?i-m)ba(?i:b)c(?+i)syntax, but according to the documentation and the PHP implementation this is invalid.All the above fail with:
Unexpected token "?" (zero_or_one) at line 1 and column 3Possible fixes
Changing the grammar to:
solves n° 1, 2, 3, 4 & 6.
n° 5 is a bit more complex... 😉
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.