Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 scrutinizing the Monastery: (12)
As of 2014-08-22 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (158 votes), past polls