Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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.

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 rifling through the Monastery: (5)
As of 2016-09-30 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (562 votes). Check out past polls.