Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,383 Programmers. There are 1,374 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Regular Expression

 
Reply to this topicStart new topic

Regular Expression

Chandrakala.patil
post 27 Apr, 2008 - 11:35 PM
Post #1


New D.I.C Head

*
Joined: 27 Apr, 2008
Posts: 2



regular expression to validate the date of format dd-mon-yyyy.
mon like apr for april
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


someone1
post 28 Apr, 2008 - 11:52 AM
Post #2


New D.I.C Head

*
Joined: 28 Apr, 2008
Posts: 6

i'm not 100% but you can try
"[0-3]?[0-9]-(jan|feb|mar|apr|may|jun|jul|aug|sep|nov|dec)-[0-9]{4}" to validate the format.

This is a POSIX statement. (ereg)

Not sure if the date entered will be valid though.

Tip: remove the question mark in the regex to REQUIRE a preceding 0 for the day part

This post has been edited by someone1: 28 Apr, 2008 - 11:52 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 03:49AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month