views:

40

answers:

1

I have a textbox containing a date in the format "dd.MM.yyyy". Now I want to use a RegularExpressionValidator to see if the format matches "digit digit . digit digit . digit digit digit digit" (without spaces)

How does the regular expression look like for this?

+3  A: 

Well, the regex "\d{2}\.\d{2}\.\d{4}" should work - but it won't validate that the values are sensible. For example, it will allow "55.66.3000".

Jon Skeet
Thanks for your answer.
citronas