This program is intended to demonstrate techniques for using the TaeRichEdit Component for basic syntax-highlighting  (in this case the highlighting is simply setting the links) and for processing custom link processing.  Scroll to the bottom and click on linked text to see what happens.

Note that the technique used here is not appropriate for substituting text.  The parsing loops assume that the size of the text has not changed.  It would have to be modified to allow arbitrary text substitution.

The buttons to the right will let you play with the various parameters of the FindWordBreak method.

There are two versions of the syntax parsing/highlighting code, ParseLinks() and ParseLinksFaster().  Use the radio buttons on the right to choose the parsing method.

There is a bit of flicker with this control.  I have tried everything that comes quickly to mind to reduce the flicker.  If you find better tricks, please let me know.  (Back in the days of DOS, you could probably solve this by ensuring that the background erase happened during the monitor's vertical retrace.  I doubt that this is a reasonable solution for Windows 32-bit programs.)

Finally, there is a bug.  When WordWrap == wwtWindow (and ScrollBars = ssVertical), the control does not respond properly to resizing the window unles you first edit the text in the control.  If you resize the window horizontally back and forth, you will see the undesired behavior.  I have seen this elsewhere and I am not sure what causes it.

============

Twas brillig and the slithey toves did gyre and gymbal in the wabe.
All mimsey were the borogroves and the mome wraths outgrabe.

