in reply to Re^2: regex match word , don't match word preceeded by slash
in thread regex match word , don't match word preceeded by slash
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: regex match word , don't match word preceeded by slash
by lepetitalbert (Abbot) on Nov 20, 2010 at 18:29 UTC |