Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regex issue (positive look-ahead)

by rubasov (Friar)
on Mar 10, 2010 at 15:42 UTC ( #827819=note: print w/ replies, xml ) Need Help??


in reply to regex issue (positive look-ahead)

In short: because the lookahead you're using is a zero-width assertion.

In a more explanatory style: your second regex means something like this: match a url part not containing slashes, followed by a slash (but do not include this slash into to the currently matched substring), and followed by the end of the string.

url part not containing slashes -|- followed by a slash |- followed by the end of the string
Those followed by clauses should be fulfilled at the same time, however your url does not contain such a substring.

update: corrected a negation error above, thanks ikegami.


Comment on Re: regex issue (positive look-ahead)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2014-07-22 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (110 votes), past polls