I want to do a preliminary check if the entered string looks like a vehicle identification number (VIN) . I know that it consists of 17 letters and numbers, but the letters I, O, and Q are not allowed inside the VIN, so I use this regex:
^[0-9A-Z-[IOQ]]{17}$
Now, if I check a string like 1G1FP22PXS2100001 with RegularExpressionValidator, it fails, but CustomValidator with this OnServerValidate event handler
Regex r = new Regex("^[0-9A-Z-[IOQ]]{17}$");
args.IsValid = r.IsMatch(TextBox1.Text);
works good.
Experiments show that RegularExpressionValidator does not support Subtraction of a character class , but the Regex class does.
Now I wonder why these two .NET classes use different regex flavors? Is this documented?