slevithan / xregexp

Extended JavaScript regular expressions
http://xregexp.com/
MIT License
3.31k stars 278 forks source link

XRegExp.escape with hyphen/comma/hash returns regex incompatible with ES6 flag u #323

Closed slevithan closed 3 years ago

slevithan commented 3 years ago

ES6 flag u disallows \-, so we need an alternative way to escape hyphens.

This is similar to #197, which fixed this for whitespace.

Edit: Same problem for escaped , and #.

slevithan commented 3 years ago

Last diff fixed in 93f300146ed594105fae1cd6f73326bbc7e2e180.