28, May 2012

Preg match for time field - webmaster forum

 
Webdigity webmaster forums
[ 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 3943 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Feb 25, 2007, 12: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Feb 25, 2007, 12:34:51 pm »

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


Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Feb 25, 2007, 12: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Feb 25, 2007, 01: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!

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6106
Tags : pregreg Bookmark this thread : Digg Del.icio.us Dzone more....

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?
May 28, 2012, 05:14:41 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!






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