Community
Why have some form validations (RegExp patterns) stopped working?
over 1 year ago by Robert Lundsten(edited)
Some of the RegExp patterns has suddenly stopped working in forms. This means that user can now input things that is not valid. The browser gives and error in the console log but to the user the error is "silent". Here is an RegExp that no longer works:
+formElement({
name: 'mobile',
label: 'Mobile phone',
pattern: '^[0-9-+\s()]*$'
})
This gives the following error in the console log:
Pattern attribute value ^[0-9-+s()]*$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^[0-9-+s()]*$/v: Invalid character class
What could be the issue?