Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Regex to get everything before first /

by FunkyMonk (Chancellor)
on Jun 06, 2011 at 21:11 UTC ( [id://908370]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex to get everything before first /
in thread Regex to get everything before first /

the non-greedy modifier which I prefer to avoid
For what reason(s)?
  • Comment on Re^2: Regex to get everything before first /

Replies are listed 'Best First'.
Re^3: Regex to get everything before first /
by ikegami (Patriarch) on Jun 06, 2011 at 22:12 UTC

    It fails poorly when there's a problem because the /.*?/ in /.*?// can match "/". It's only indirectly through co-operation with the rest of the pattern that it might be prevented from doing so. I prefer being more direct and explicitly prevent what should not be matched from matching.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-23 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found