I have the following Regular Expression in VB.NET which works just fine.
(Istr_)*(8[25]\d{5}[0-9xX]{2}|DR\d{5}[0-9xX]{2}|R\d{2}-\d{4})
However, I want the "Istr_" part only to be case-insensitive, while the rest of the expression remains case-sensitive. I attempted that by simply adding "?i:" according to the MSDN documentation like so:
(?i:Istr_)*(8[25]\d{5}[0-9xX]{2}|DR\d{5}[0-9xX]{2}|R\d{2}-\d{4})
But this breaks the RegularExpressionValidator
in my form.
Does the *
have something to do with this? I'm not sure is the appropriate character to join the patterns. I want the first pattern to be an optional case-insensitive prefix to the second pattern.
Furthermore, I don't want to allow spaces, which I haven't been able to figure out how to do yet.
Thanks. :)