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

Re: perl string extract

by Utilitarian (Vicar)
on Oct 04, 2010 at 13:54 UTC ( [id://863346]=note: print w/replies, xml ) Need Help??


in reply to perl string extract

Anchor your regex eg.
$line=~ s/^ #Anchor at the beginning of the line logfile\s*=\s*([^,]*?) # As before (:?,.*)? # non-capturing optional block beginn +ing with a comma $ # Anchor at end of line /$1/x;

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found