The JavaScript regex flavor is extremely limited compared to .NET (C#). One of the many features it doesn't support is inline modifiers of the form (?i)regex
or (?i:regex)
. However, because you're using the new RegExp(params)
constructor, you should be able to pass the modifier as the second parameter:
"^[A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?\s?[0-9][ABD-HJLN-UW-Z]{2}$",
"i"