this can potentially get very complicated
will the "terms" always be single words, or could they be multiple words?
will you be needing to modify plain text, or existing html?
turning single words, that are just plain text into html links is very easy. but if there is existing html mixed in, it makes it a bit more complicated. then, if the terms might be more than 1 word long, the complexity escalates further.
in any case, your going to want to know at least the basics of regular expressions to accomplish this.