Regular expression date verification

User 1948955 Photo


Registered User
21 posts

I found a regular expression in an on library, but it does not seem to work. It accepts a few variations of correct date formats. Any thoughts on what is wrong with the following?

/^\d{1,2}\/\d{1,2}\/\d{4}$/

I should accept 1/1/01 as well as 01/01/2012. Or maybe it must always be a four number date?


Gary
User 187934 Photo


Senior Advisor
20,271 posts

There's a bug with the regular expression in the form builder. This expression may cause it. One way to tell is to look in your form builder folder and open the validation_data.js. You should see your rex expression in there. If it has a bunch of ////// all around it then that's the problem.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

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.