Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by lepetitalbert (Abbot)
on Nov 19, 2010 at 03:19 UTC ( [id://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

Replies are listed 'Best First'.
Re^3: regex match word , don't match word preceeded by slash
by kcott (Archbishop) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://872411]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2025-07-14 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.