Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
8/11/13 i want to create this date with regular expression in vb.net plzzzz anyone help me i cant understand this plzzz
Posted
Comments
Maciej Los 8-Jul-14 14:31pm    
You can't!
You can only create pattern to find date in above format: \d{1}/\d{2}/\d{2}, which means:
\d{1} - one digit
\d{2} - two digits
/ - date parts separator
chetan9769518306 10-Jul-14 5:42am    
thanx for help
Maciej Los 10-Jul-14 5:45am    
You're very welcome ;)

1 solution

Don't.
You can write a regex to validate a date: http://www.regular-expressions.info/dates.html[^]...but it's a poor solution to teh problem.

Instead, use DateTime.TryParseExact[^] which is a lot easier to read, and even converts it to a DateTime value for you to use in future!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900