0

The recent chrome v 133 not accepting some special character in character class, for example :

^[\u4e00-\u9faf ,.'-]+$, it's not valid in chrome 113 and giving Pattern attribute value ^[\u4e00-\u9faf ,.'-]+$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^[\u4e00-\u9faf ,.'-]+$/v: Invalid character in character class error, and must be like this in order to work :

^[\u4e00-\u9faf ,.'\-]+$ => adding a backslash to "-".

But precedent versions and mozilla are working fine, and i didn't fine any documentaion for it, is this a bug for chrome and engine v8 in general ?.

trying ^[\u4e00-\u9faf ,.'-]+$ regular expresion, expecting to work as previous version of chrome.

InSync
  • 4,851
  • 4
  • 8
  • 30
  • HTML `` patterns are now compiled with the recently-added `v` flag, which requires you to escape `-` inside character classes. See the comments at [this question](https://stackoverflow.com/q/76462550). – InSync Jun 14 '23 at 16:55

0 Answers0