Regular Expressions Help


Registered User
25 posts

Does anyone know how to add forward slashes into regular expressions? I am trying to create a date field in the format of DD/MM/YYYY, i have set it up to only allow number and only 8 of them, just need to workout how to add forward slashes in. I would use the date field already in WFB but you have to go through each mouth in order to get to the year you want.

Thanks, David...


Senior Advisor
10,374 posts

http://www.coffeecup.com/help/articles/ … xpressions

Hope that helps, haven't looked at it, but that's the 2 articles that CC has about Reg. Expressions.
Jo Ann

http://elementsinwebdesign.com

Some websites created by Elements in Webdesign:
http://cattownrescue.org - A friends site I created to help raise awareness to help stray cats in her area.
http://northbaldwinliteracycouncil.org - the local Literacy Council in my city.
http://lalookssalon.com - one of the local hair dressers in my town.
http://gregmaisfund.com - Dedicated to a friend who recently passed away from Lung Cancer.



Registered User
72 posts

Another great resource to try out is:

http://regexlib.com

They have tons of user submitted samples online, including a way to test them online. I think the first entry in their date section is just what you need:

http://regexlib.com/Search.aspx?k=date

Just change the {1,2} options to {2} (enforcing 2 digits are specified, not 1 or 2) and you should be set.

If you get a chance, take the time to learn regular expressions. They opened up my coding to a whole new realm of possibilities because they are THAT powerful!

Hope this helps!

[:: Sean ::]
http://about.me/dillieo

Code slinger... Egg hunter extraordinaire...

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.