Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: regex match word , don't match word preceeded by slash

by lepetitalbert (Monsignor)
on Nov 19, 2010 at 03:19 UTC ( #872411=note: print w/ replies, xml ) Need Help??


in reply to Re: regex match word , don't match word preceeded by slash
in thread regex match word , don't match word preceeded by slash

Hi again kcott,

I tried so many combinations I can't remember why those spaces where there ! thank you again

I'm trying to undertand

(?<![-\w./])

so the / is the one preceeding the word
but I don't get the -\w.
if someone has 2 minutes left :)

thank you too Anonymous Monk, I took a look at HTML::TreeBuilder but I wouldn't have found your solution in one afternoon ! ( is that english ? )

Have a nice day !

"There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates


Comment on Re^2: regex match word , don't match word preceeded by slash
Download Code
Re^3: regex match word , don't match word preceeded by slash
by kcott (Abbot) on Nov 19, 2010 at 03:54 UTC

    In the href part, if you just have the slash in the lookbehind, the regex engine finds that gi-programming-with-perl.zip is a match and you end up with: /c<b>gi-programming-with-perl.zip</b>. By saying not a slash or any other character I'm trying to match, /cgi-programming-with-perl.zip does not match at all; the content, however, has a greater-than in that position (which is neither a slash nor a character your looking for, i.e. [-\w.]) so it does match. In my second example, the whitespace doesn't match [-\w./], so it works here also.

    -- Ken

      Thanks again :)

      "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2014-10-21 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls