Posts: 1
Threads: 1
Joined: Aug 2009
Reputation:
0
08-27-2009, 06:23 PM
Hi Ankur,
Can you please tell me how i will user regular expression for date which has the mm/dd/yyyy format.
I have to validate using regular expression.
Thanks,
Dheeraj
Posts: 19
Threads: 5
Joined: Aug 2009
Reputation:
0
08-27-2009, 08:16 PM
Hi Saket,
Why your pattern is getting failed for Valied dates below.
09/23/1247 - Fails
03/12/2214 - Fails
Could you please explain? and make sure post doesnt have such requirement to match only years (1900 - 2099).
Thanks,
Azeem
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
08-27-2009, 08:33 PM
Yes definitely it would fail because, you see at the end where I have set pattern for year I have mentioned (19|20), this will allow you to compare only for year 1900 to 2999, But this can be manipulated as per your requirement. try replacing (19|20)\d\d with \d{4}.
what do you mean when you say ' make sure post doesnt have such requirement to match only years (1900 - 2099).'? we are here to help you with our best, whatever we have we can suggest only. I dont think we should fulfill the exact requirement, let the guy do some on his own. whatever I have posted is just a suggestion.
Apologies if I posted something wrong.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-28-2009, 12:30 PM
@ Everyone - Please restrict yourselves from Indulging in Destructive Arguments. We are here to help all with whatever we know and nobody is born with the right solution. Please Understand that providing the Exact solution never eliminates the Root cause of the problem but only prompts for more desperation. A clue or a lead is what necessarily helps anyone to learn.
On a thought , Please stop spitting venom on your co-members of the forum. If there is something wrong please notify the moderator or post a comment which does not hurt anyone. Mistakes are a mode to learn more and not to be used to suppress someone.
As the answer has been provided there is no requirment for anyone to continue arguing or posting on this thread.
Thread locked !!
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.