sah18
asked on
regular expression validator for textbox to hold a time
Can someone help me with how to set a validator for a textbox control to make sure that a valid time has been entered?
Time in in 24-hour format (examples):
9:00 or 09:00
13:00
23:59
I'm thinking I need to use the regular expression validator for this, but I'm not certain is that's the right validator to use.
thanks.
Time in in 24-hour format (examples):
9:00 or 09:00
13:00
23:59
I'm thinking I need to use the regular expression validator for this, but I'm not certain is that's the right validator to use.
thanks.
Hey this is an expression using regular expression validator:
^(20|21|22|23|[0-1]\d)[0-5 ]\d$
but this works only like this:
07:30 wrong
0730 correct
try it and you will see
also follow this link..its a tutorial to code validators..
http://www.intellectualconceptsinc.com/library/regular%20expressions.pdf
^(20|21|22|23|[0-1]\d)[0-5
but this works only like this:
07:30 wrong
0730 correct
try it and you will see
also follow this link..its a tutorial to code validators..
http://www.intellectualconceptsinc.com/library/regular%20expressions.pdf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
rstrader- i just finally got around to trying this today. it works perfectly! exactly what i was hoping for!!
do you know of any good tutorials on regular expression syntax? i'd really like to learn it better! thanks again.
do you know of any good tutorials on regular expression syntax? i'd really like to learn it better! thanks again.
http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256DA3007B8FBB
-Nauman.