in reply to Re: Re: Re: Linking words in html to glossary.
in thread Linking words in html to glossary.

Yeah. Now that I've looked at it a bit more, something kinda like this should work:

$file =~ s/(\s+)($word)([\.\?\!]?\s+).*?(?!</a>)/"$1<a href=\"".$gloss +ary{$word}{'link'}."\">$2<\/a>$3"/eig;

The .*(?!</a>) should then say that the engine will match the word plus (optionally) stuff after it unless that mess is ended by a </a>.

PerlStalker