Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: regular expression for "time-of-day" is not working

by DrHyde (Prior)
on Apr 05, 2012 at 09:58 UTC ( #963635=note: print w/ replies, xml ) Need Help??


in reply to regular expression for "time-of-day" is not working

It's got other problems too. It won't match "09:02" or "23:02" or "00:02". You probably want something like this ...

/\b ( ( ([01][0-9]|2[0123]):[0-5][0-9] ) |( (1[012]|[1-9] ):[0-5][0-9]\s+[ap]m ) ) \b/ix


Comment on Re: regular expression for "time-of-day" is not working
Download Code
Re^2: regular expression for "time-of-day" is not working
by vjvalor (Initiate) on Apr 05, 2012 at 12:02 UTC
    Thanks you DrHyde. I was interested in 12-hour time format with no preceding 0.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2015-07-04 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls