don’t do replace words if there is a dash before or after the word
This commit is contained in:
parent
f5cf55a022
commit
2deb6dc799
@ -1545,7 +1545,7 @@ namespace Volian.Controls.Library
|
|||||||
// don't use the \W, i.e. don't bother to look for a non-word character.
|
// don't use the \W, i.e. don't bother to look for a non-word character.
|
||||||
string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)";
|
string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)";
|
||||||
string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)";
|
string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)";
|
||||||
string pat = wordMatchBeg + @"(?<!\\u160\?)" + replaceWord + @"(?!\\u160\?)" + wordMatchEnd;
|
string pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?)" + replaceWord + @"(?!\\u160\?|\\u8209\?)" + wordMatchEnd;
|
||||||
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
|
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user