diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 0ad7600a..59fbd10d 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -1644,8 +1644,10 @@ namespace Volian.Controls.Library // ReplaceStrData xml node is empty, it does the inheritance and gets the 'base' format's list. if (rsl.Count==1 && (rsl[0].ReplaceWord == null || rsl[0].ReplaceWord == "")) return Text; // Loop through text looking for words to be replaced + List partialReplaceList = new List(); foreach (ReplaceStr rs in rsl) { + bool dopartial = false; bool replaceit = false; // note that the order of this check is important. Check in this order... // background here @@ -1662,6 +1664,11 @@ namespace Volian.Controls.Library { if (!dicReplaceRegex.ContainsKey(rs)) { + if ((rs.Flag & E_ReplaceFlags.Partials) == E_ReplaceFlags.Partials) + { + partialReplaceList.Add(rs); + dopartial = true; + } // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline; RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase: RegexOptions.None; @@ -1671,20 +1678,23 @@ namespace Volian.Controls.Library string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)"; string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)"; string pat = wordMatchBeg + @"(?