Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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'";
--Stevie-O
$"=$,,$_=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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://371723]
help
Chatterbox?
Discipulus shutdown and logoff seem untrappable by Perl on win. But it is in Cygwin. but i cannot switch to it
[choroba]: It has the widest rear seats space available in the same price category - needed for the 3 kids.
Discipulus families growth is related to price of cars nowadays..
[choroba]: price of anything, unfortunately
[Discipulus]: yes, unfortunately.
[Corion]: Discipulus: you can "easily" trap shutdown/logoff in a Win32::GUI application by capturing and responding to the appropriate message

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-01-17 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (154 votes). Check out past polls.