Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Help with a more precise regex

by Nkuvu (Priest)
on Apr 25, 2003 at 19:58 UTC ( [id://253234]=note: print w/replies, xml ) Need Help??


in reply to Help with a more precise regex

It could be painfully obvious (just suggested as an alternative):

if ($value =~ /^(\d+)d$/i) { $day = $1; } elsif ($value =~ /^(\d+)d\s+(\d+)h$/i) { $day = $1; $hour = $2; } elsif ($value =~ /^(\d+)h$/i) { $hour = $1; } else { print "Hork!\n"; }

What exactly do you want out of this?

Update: Sorry, just ignore this post. It's too ugly to live. ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found