I'm writing a custom HTML mark-up form that will take in text and format it in a specified way. One of the functions is to add <span> tags to certain subheader phrases and words. What I want to do is to be able to highlight the subheader phrase and then use Regex to take the selected text and replace all other instances of it, except for those that already have span tags. For instance:
For the most part, it seems to be working, but I've found that it replaces partial matches as well. For instance, highlighting "Who" replaces any instance of "W" or "Wh" as well. Any thoughts as to how to fix this? I'm using .NET 4.0. Thanks in advance!