Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by DrHyde (Prior)
on Apr 05, 2012 at 09:58 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://963635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-23 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found