9, July 2008

Preg match for time field - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Validate_fields Class (Moderator: Olaf)
Topic: Preg match for time field
« previous next »
Pages: [1] Print

Author Topic: Preg match for time field  (Read 946 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Feb 25, 2007, 01:29:29 PM »

Hi Olaf,
What whould be the preg_match pattern to check a time field?
I tried the next line, but no joy...
Quote
"/^(0?[1-9]|1[0-9]|2[0-3])[:](0?[1-9]|[1-5][1-9])[:](0?[1-9]|[1-5][1-9])$/"
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6274
38470 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Feb 25, 2007, 01:34:51 PM »

don't have the time at the moment to check this, do you tried this website?
http://regexlib.com/DisplayPatterns.aspx Visit through proxy



Last blog : 4th of July Lottery from TemplateMonster.com
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Feb 25, 2007, 01:50:01 PM »

Ok, thanks for the reply Olaf, I found better lcuk with this:  Cheesy
Code:
"/^([0-1][1-9]|2[0-3])[:]([0-5][0-9])[:]([0-5][0-9])$/"
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6274
38470 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Feb 25, 2007, 02:51:25 PM »

Ok, thanks for the reply Olaf, I found better lcuk with this:  Cheesy
Code:
"/^([0-1][1-9]|2[0-3])[:]([0-5][0-9])[:]([0-5][0-9])$/"

yes this one is cool!


Last blog : 4th of July Lottery from TemplateMonster.com
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6106
Tags : pregreg Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Validate_fields Class (Moderator: Olaf)
Topic: Preg match for time field
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 09, 2008, 01:32:38 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.590
Total Topics: 7.356
Total Members: 3.661
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: komrad

37 Guests, 4 Users online :

17 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.