Quoting MDN on the pattern
attribute:
... No forward slashes should be specified around the pattern text.
The forward slashes are JavaScript syntax for regular expression literals.
Quoting from the same page:
... the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII.
And quoting MDN's Guide Regular expressions:
- Unicode regular expressions do not support so-called "identity escapes";
that is, patterns where an escaping backslash is not needed and
effectively ignored. ...
This means only required character escapes are valid.
You should also be aware that ... (quoting from the same page)
- The
-
character is interpreted differently within character classes. In particular, for Unicode regular expressions, -
is interpreted as a literal -
(and not as part of a range) only if it appears at the start or end of the character class.
In conclusion, your first pattern in fixed could look like this:
<input type="text" pattern="^[a-zA-Zà-úÀ-Ú0-9äöüÄÖÜß@\s+\-_\.,\{\}\[\]\(\)#']+$">