Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regular expression object property

Status
Not open for further replies.

joyceda59

Technical User
Apr 3, 2007
29
0
0
CA
Hi

im using the regular expression object property 'Pattern' to validate my time. I have created the condition but it seems that there is something wrong with it. When i do the testing the conditions are not applying.

My condition for time example(not case sensitive): 12:00 PM

or: 12:00PM

or there is a case where the user can type(not case sensitive): asap

here is my line of code:

"^((([0][0-9])|(([1][0-2])|[0-9])):((([0-5][0-9]) AM|PM) |([0-5][0-9]AM|PM))) | (ASAP)$ "

i know i have some syntax error in there but not able to find what the error is. Plz advise
 
Maybe like this:
"^((([0][0-9]|[1][0-2])|[0-9]):([0-5][0-9])\s?(AM|PM))|ASAP$"

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
meant to put.
"^((([0][0-9]|[1][0-2])|[0-9]):([0-5][0-9])\s?(AM|PM))$|^ASAP$"

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top