I am after a leg up with the following in C#.
I want to replace various names / alias for one common name.
The input string is one string which contains multiple lines in it. Search to be case insentive.
e.g. master word "Fred Project" to replace :
"Fred." or "Fred. " or "Fred " (Fred space) but not the Fred in "Fred Project" also NOT "Fred.txt"
(i.e. if Fred is stand alone or at the end of a sentence, then replace, if fred is part of something else, don't)
I don't care if i have to loop a loop for each name or if the expression can handle the lot.
Regex.Replace() is what i am using.
I have it kind of working but don't have the syntax right for the replacement, e.g.
Freddy considerations => Fred Projectconsiderations (WRONG)
Freddy considerations => Fred Project considerations (RIGHT)
That is because although my match works (Freddy(\s?)) the system thinks my replacement string needs to include the extra whitespace characters...