Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Why is this regex greedy?

by Stevie-O (Friar)
on Jul 04, 2004 at 17:04 UTC ( #371723=note: print w/ replies, xml ) Need Help??

in reply to Why is this regex greedy?

Using a regular expression along isn't necessarily what you want.

Remember: Perl is more than just regular expressions :)

$str = '/a/b/c/d/e/abc00000'; $end = (split '/', $str)[-1]; # pull the last element split() returns print "we wanted '$end'";
$"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc

Comment on Re: Why is this regex greedy?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2015-11-24 23:52 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (666 votes), past polls