View Single Post
Old Dec 7th, 2005, 2:11 PM   #1
MegaArcon
Programmer
 
MegaArcon's Avatar
 
Join Date: Aug 2005
Posts: 66
Rep Power: 0 MegaArcon is an unknown quantity at this point
Regular Exp help

Yo all! ^_^

I'm trying to make a reg exp that will match a users inputed time. I want the RE to match a string like 8:00am or 12:00pm. My version of the RE is as follows:

var regEx = new RegExp ("(1-12):(0)*(0-60)(am|pm)")

But...of course...it dosen't work. It ALWAYS returns false. (I'm not great with RE... ) Can I get some help? And just to point out, I want the test to fail if it is not in the form (x)x:xx(am|pm).

Thanks a lot! ^_^
MegaArcon is offline   Reply With Quote