ASP .NET Validation Failure

I think I've found a failure in the Regular Expression validator for ASP .NET.

If you choose US Zipcode from the validation expression list, it gives you the following expression:

\d{5}(-\d{4})?

The problem is that the expression passes "2961534" as a valid zipcode.

The fix is extremely simple--simply add the beginng and end flags to the existing expression:

^\d{5}(-\d{4})?$

This was found by our QA department--way to go guys!

So, does anyone here know where I can go to edit the list of regular expressions offered me by the Regular Expression Validator control?

Comments

# re: ASP .NET Validation Failure

Wednesday, February 02, 2005 4:43 PM by Alan Yeung

Leave a Comment

(required) 
(required) 
(optional)
(required)