in reply to Finding changed words

No one answered half your question so I'll take a stab at it. You need the "bolding" to survive the conversion process to "entities".

The number one suggestion would be to run both texts thru encode_entities BEFORE comparing them. Then your added HTML is safe. A second suggestion would be to use a special chracter that can't appear in the body. like \0175 or some really low char like \f the formfeed char. encode_entities will likely grab that and turn it into something like ý or some so that after encode_entities you can regexp that marker with the html you want. Use one marker for bold on and one for bold off.

--
$you = new YOU;
honk() if $you->love(perl)

Replies are listed 'Best First'.
RE: Re: Finding changed words
by tye (Sage) on Sep 16, 2000 at 01:47 UTC

    FYI, my solution encoded HTML entities by hand during output so the bolding code doesn't get turned into entities.

            - tye (but my friends call me "Tye")