T
Toska
Hi again
Follow up on my previous thread where I got help to enclose specific
words in markup code. After some modifications it looks like this:
Code:
--------------------
void SomeMethod()
{
string words1 = "dog|cat|pig|horse|hippo";
string text1 = "hadsf das adh f dog adhsf yagds uyaudfyas gdf pig afsd.
agfg afd gasd fgasd g dog. aygs fag fiusadf gi cat ";
text1 = Regex.Replace(text, "dog|cat|pig|horse|hippo", new MatchEvaluator(MarkupBuilder));
}
static string MarkupBuilder(Match m)
{
string x = m.ToString();
if(...)
return ...;
return ...;
}
--------------------
The above works well, but the new problem is that when a word is a part
of another word it is also captured. As follows.
Code:
Follow up on my previous thread where I got help to enclose specific
words in markup code. After some modifications it looks like this:
Code:
--------------------
void SomeMethod()
{
string words1 = "dog|cat|pig|horse|hippo";
string text1 = "hadsf das adh f dog adhsf yagds uyaudfyas gdf pig afsd.
agfg afd gasd fgasd g dog. aygs fag fiusadf gi cat ";
text1 = Regex.Replace(text, "dog|cat|pig|horse|hippo", new MatchEvaluator(MarkupBuilder));
}
static string MarkupBuilder(Match m)
{
string x = m.ToString();
if(...)
return ...;
return ...;
}
--------------------
The above works well, but the new problem is that when a word is a part
of another word it is also captured. As follows.
Code: