Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Weird Regexes Stuff

by AnomalousMonk (Archbishop)
on Aug 19, 2011 at 07:47 UTC ( [id://921168]=note: print w/replies, xml ) Need Help??


in reply to Re: Weird Regexes Stuff
in thread Weird Regexes Stuff

The updated solution still has a problem, IMO, with that pesky  \W anchoring the start of the match. Is the following really what you intend?

>perl -wMstrict -le "my $input = '12:00am, 5:00pm,8:30AM'; while ($input =~ m/\W([1-9]|[01][0-2]|2[0-3]):[0-5][0-9][ap]m/gsi) { print qq{This is a valid time!\t$&}; } " This is a valid time! 5:00pm This is a valid time! ,8:30AM

Log In?
Username:
Password:

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

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

    No recent polls found