Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Search a match to a regex from the END of a string

by flexvault (Parson)
on Mar 15, 2013 at 14:17 UTC ( #1023706=note: print w/ replies, xml ) Need Help??


in reply to Search a match to a regex from the END of a string

Doctrin,

And there is 'rindex' which is very fast and easy to use.

perl -e '$d="/usr/local/bin/perl"; $i=rindex($d,"\/"); print substr +($d,$i+1),"\n";'
which prints 'perl'. The Camel book has examples of how to do recursive searches.

Good Luck...Ed

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Search a match to a regex from the END of a string
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-09-16 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (48 votes), past polls