[ACCEPTED]-Have HTML5's a inputs pattern attribute ignore case-input
Accepted answer
I don't think it is possible.
The specification 10 on
<input pattern>
[1,2] specifies thatthe pattern uses the 9 ECMAScript (i.e. Javascript) flavor of regex
it 8 is compiled "with the global, ignoreCase, and 7 multiline flags disabled"
In Javascript, the 6 only way to make a regex ignore case is 5 to set the modifier externally (
/.../i
). The PCRE 4 syntax(?i)
is not supported.
Therefore, the pattern is always case-sensitive and 3 [a-zA-Z]*
(i.e. making the regex itself explicitly 2 case insensitive) is the only way to match 1 the pattern in a case-insensitive way.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.