Question: I am trying to validate a date entered into a text box. There is an input mask on the textbox which forces input of xx/xx/xxxx. I am trying to use a regular expression validator to enforce that a correct date is entered. I am not skilled in RegEx bascially at all. My co-worker found this one on the internet but I can't really tell what it's doing.

Does this look right? Seems overly complicated...

```
(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)

```

Does anyone know of a less complex expression that essentially does what I need?

Answer: 
Why not use one of the methods available in the [`System.DateTime` namespace](http://msdn.microsoft.com/en-us/library/system.datetime_methods.aspx)? You could use [`DateTime.TryParse()`](http://msdn.microsoft.com/en-us/library/ch92fbc1.aspx) (**edit:** [`DateTime.TryParseExact()`](http://msdn.microsoft.com/en-us/library/system.datetime.tryparseexact.aspx) is probably the right suggestion) to accomplish the validation.
```
([0][1-9]|[1][0-9|][2][0-9]|[3][0-1])\/([0][1-9]|[1][0-2])\/[1-2][0-9][0-9][0-9]

```

for dd/mm/yyyy (year can be from 1000 to 2999)

or

(([0][1-9]|[2][0-9]|[3][0-1]|[1-9]|[1][0-9])/([0][1-9]|[1][0-2]|[1-9])/([1-2][0-9][0-9][0-9]|[0-9][0-9]))

which includes d/m/yy (e.g. 1/12/82)