B2016-182 fixed replace word logic that was replacing words surrounded by dashes
This commit is contained in:
parent
6a737a961d
commit
f989e52a13
@ -1933,7 +1933,7 @@ namespace VEPROMS.CSLA.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\?|\\u8209\?|\\b)" + replaceWord + @"(?!\\u160\?|\\u8209\?)" + wordMatchEnd;
|
string pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-)" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-)" + wordMatchEnd;
|
||||||
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
|
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
|
||||||
//ProfileTimer.Pop(profileDepth3);
|
//ProfileTimer.Pop(profileDepth3);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user