Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 surveying the Monastery: (10)
As of 2014-10-22 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (119 votes), past polls