fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.63k stars 262 forks source link

You can't use atomic group in PHP regex #1295

Closed jcubic closed 6 months ago

jcubic commented 6 months ago

This is valid syntax in PHP regex:

$re = '/(?>foo)/';

The ?> is a valid syntax inside the string. But web-mode marks it as the end of PHP code and makes everything after look like fundamental mode. This syntax is atomic group.

I'm not sure if you can do anything with this, but without handling this the code needs to be modified just to work with web-mode in Emacs.

The option is to use:

$re = '/(?' . '>foo)/';

But this is just a hack to make web-mode happy.

fxbois commented 6 months ago

Hi, it has already been reported. Too difficult to solve.