File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Java in General
Validating Time Format (HH:MM:SS)
Joined: Nov 27, 2005
Sep 01, 2006 01:01:00
I m trying to validate Time which is HH:MM:SS format. But not able to do it.
Suppose input = 34:67:78
pat = " ( [0-1]+[0-9]+) |([0-3]+) : ( [0-5]+[0-9]+) : ([0-5]+[0-9]+ ) ";
p = Pattern.compile(pat);
Its validating this input...
Plzz tell me wat is wrong in this ???
Joined: Oct 20, 2005
Sep 01, 2006 01:42:00
The + after the  is making one or more cases. Remove + it will work.
More inputs are welcome.
Don't get me started about those stupid
subject: Validating Time Format (HH:MM:SS)
how to get the last modified time of a text file
time comparison between given periods
problem in getting date and time in textbox
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014