I want to verify if the date provided is in the correct format. It doesn’t matter if the date is correct or not. I am only interested in the format. And, I don’t how to handle it. Here is the regular expression that I am using
My complete expression is .+(\b[0-9]?\b).+(\d{2}/\d{2}/\d{4})
but the date part is
(\d{2}/\d{2}/\d{4})
This works good if the date is 07/02/2011 but it doesn’t work if the date is 7/2/2011
I tried (\d{1-2}/\d{1-2}/\d{4})
but that didn’t help.
try the following (It replaces the dashes with commas):