Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-08-30 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls