in reply to regex to match content not inside an HTML anchor or other tags

...perhaps a mere detail, but whence cometh the target address if you're seeking words which are NOT addresses? (The rest of your post suggests you already know this, but your example, '"using MySQL",' won't work -- alone -- as a link and if you're using a __DATA__ set or similar to provide appropriate links for specific words or phrases from an unlimited set of possible, you're going to have issues other than those posed here.)

So show us/tell us a bit more about your efforts and algorithm.

  • Comment on Re: regex to match content not inside an HTML anchor or other tags

Replies are listed 'Best First'.
Re: regex to match content not inside an HTML anchor or other tags
by GregHurrell (Initiate) on Jun 27, 2005 at 14:44 UTC

    Ok, problem solved. In the end I did use a (very simplistic) tokenizer. I didn't post source code with my original question because I'm actually working in PHP (but with Perl compatible regular expressions). I wanted a regex-only solution, but in the end tokenizer+regex seemed to be the shortest and most robust solution.

    If you follow this link you'll see a more detailed explanation and there's a link to the source.

    http://greghurrell.net/wp/2005/06/27/autolink-plug-in/