Click here to Skip to main content
14,305,681 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,

Can anybody help to validate dates(including leap year) using Regex in c#.net

REGARDS
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You could use Regex expressions in conjuction with TryParse to get leap year validation.
Validation with Regular Expressions Made Simple[^] describes this approach in the Date validation section.
   
Comments
Prashanth.P.Koppal 12-Jan-12 2:38am
   
Hi Abhinav,
thanks for ur Reply,
Yes,i hv used the RE which consists of '\/',which is displaying error as 'unrecognized escape sequence'.
Amir Mahfoozi 29-Jan-12 4:27am
   
+5
Abhinav S 29-Jan-12 4:29am
   
Thank you Amir.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100