[ACCEPTED]-Have HTML5's a inputs pattern attribute ignore case-input

Accepted answer
Score: 69

I don't think it is possible.

  1. The specification 10 on <input pattern> [1,2] specifies that

    • the pattern uses the 9 ECMAScript (i.e. Javascript) flavor of regex

    • it 8 is compiled "with the global, ignoreCase, and 7 multiline flags disabled"

  2. 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.

More Related questions