You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a regex mask that includes the case insensitive flag /i, the flag is getting applied as a mask character instead of being used by the regex. I am creating a regex for US states, but want to allow the user to enter upper or lower case.
Using the regex: /(?:AL|AK|AZ|AR|CA|CO|CT|DE|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY|NE)/i the mask shows as /__/i. How do I get the case sensitive flag to get used by the regex vs applied to the mask.
Thank you. I misunderstood the casing option to be where it applies it to the unmasked value after user entry, but not that it was used when applying the regex. But agree this works great. Thank you! I have updated the fiddle (https://jsfiddle.net/6qy09jow/) and works great:
When using a regex mask that includes the case insensitive flag
/i
, the flag is getting applied as a mask character instead of being used by the regex. I am creating a regex for US states, but want to allow the user to enter upper or lower case.Using the regex:
/(?:AL|AK|AZ|AR|CA|CO|CT|DE|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY|NE)/i
the mask shows as/__/i
. How do I get the case sensitive flag to get used by the regex vs applied to the mask.Thanks.
The text was updated successfully, but these errors were encountered: