Page 1 of 1

need ereg expression

Posted: Wed Aug 18, 2004 12:23 am
by bugthefixer
my user enters time in the followin format

22:40

now i want to check whether user enters the same format i.e it should not be allowed to enter

22;40 or 22L40 or anything like tat

i need an ereg expression tat can check tat..
anybody can tell me how can i do tat

Posted: Wed Aug 18, 2004 12:28 am
by feyd
untested

Code: Select all

^(2ї0-4]|ї0-1]?ї0-9]):(ї0-5]?ї0-9])$
should allow 2:9 for 02:09 as well, unless you want it strict.. (just remove the ? marks then)