I have a string containing words that i need to match like the one below, it is constant and the other string that can be changed may contain words from this string \'s\'.>
What I would do is use a stemmer (such as the Porter stemmer), split the strings using a split(' ') and go through each. Compare the stemmed version of both words and then bold the ones which match.
foreach (string t1 in term1.split(' '){
foreach (string t2 in term2.split(' '){
if (Stemmer.Stem(t1).equals(Stemmer.Stem(t2)){
//do whatever here
}
}
}
On the porter stemmer including source code:
http://tartarus.org/martin/PorterStemmer/