Hi all: I need to match similar words using RexEx. For example, if I have a pattern which contains a word like "autonomous", it should match the word "autonomy" without matching "autonomous".
Example Code:
void modify(string word)
{
string input = "This island is a colony; however,it is autonomous and " +
"receives no orders from the mother country, autonomy, N.";
string pattern = @",\s" + word + @"\s[v|n|adj]\.";//word = "autonomous";
Regex reg = new Regex(pattern);
string output = reg.Replace(input, ".");
}