-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error causing problem in pattern validation for HTML inputs since version update #3106
Comments
Which field are you entering a value for, if any, such that this error results? Part of this pattern looks like an email address pattern, but I don't recognize the beginning as anything we are generating explicitly. |
I can repro it in Chrome at this page: |
I have the same issue with a much simpler pattern: [-a-z0-9_] |
I have the same problem in Chrome with input patterns. Seems like a /v regex flag is using now by default and has a different syntax than before. https://groups.google.com/a/chromium.org/g/blink-dev/c/gIyvMw0n2qw |
A regular expression is a powerfull tool for fast text pattern matching. <input type="text" Error is thrown when form is submitted (I assume the regexp pattern for that input field is "instantiated" and tested against the field's input value) So my original pattern expression was:
Tried to use this expression in browser console. All pattern matching worked fine. Replaced the original expresion by :
I "just" escaped the "-" at the start of a character class : Reported error happens in (an)other browser. Not just Chrome. BTW: I've never heard of this "-v" flag. Instantiating a regular expression in the browser's console throws the reported OP error. ("Invalid character in character class") Thank you. |
💗 |
Những nội dung này OK 💗 |
Just ran into the same issue. As @Kovalchik8 mentioned, the v option is now used to compile the For my issue, I had to escape some special chars in character classes in conjunction with String.raw. Some useful doc here: whatwg/html#7908 For testing, you can try https://regex101.com/ and enable the |
Our fix was deployed last month. |
Error causing problem in pattern validation for HTML inputs, at least since version:
114.0.5735.133
In console is visible this errore:
I tested with old version of both Chrome and Chromium and the issue was not present in versione:
113.0.5672.92
The issue is also not present in Firefox and Firefox based browsers.
The text was updated successfully, but these errors were encountered: