Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 exploiting the Monastery: (8)
As of 2014-12-26 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls