[Bug 11011] Since Javascript does not support mode specifiers inside the regular expression, there is no simple way of matching a single word case-insensitively besides turning into [Ww][Oo][Rr][Dd]

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11011

--- Comment #1 from Vegard Larsen <vegard@xaltra.net> 2010-10-12 12:56:31 UTC ---
A small use case: you wan't to validate a password (simply [A-Za-z0-9]{5,}),
but cannot accept any case-variation of the word "password":

    <input 
      type="password" 
      name="foo" 
      pattern="(?![Pp][Aa][Ss][Ss][Ww][Oo][Rr][Dd])[A-Za-z0-9]{5,}" 
      required />

This becomes tedious very quickly. If mode specifiers were supported in
Javascript regular expressions, one could try:

    (?i)(?!password)[A-Za-z0-9]{5,}

According to the spec, this should be equivalent to:

    /^(?:(?i)(?!password)[A-Za-z0-9]{5,})$/

This would have worked if Javascript's regular expressions had supported mode
specifiers (it works when parsed as PCRE or a Java or a .NET regex).

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 12 October 2010 12:56:33 UTC