C2021-061 BNPPalr & BNPP1 don’t process replace words if they are delimited with “,’ (double & single quote)

This commit is contained in:
Kathy Ruffing 2021-11-03 15:04:58 +00:00
parent c6fd85afd5
commit 3f47ed8825
2 changed files with 12 additions and 0 deletions

View File

@ -2122,6 +2122,9 @@ namespace VEPROMS.CSLA.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 + @"(?<!\\u160\?|\\u8209\?|\\b|\-)" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-)" + wordMatchEnd;
// C2021-061: For Barakah don't do replace if word is surrounded by " or ', i.e. they are no longer delimiters
if (_MyItemInfo != null && _MyItemInfo.ActiveFormat != null && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.NoReplaceQuoteWords)
pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-|""|')" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-|""|')" + wordMatchEnd;
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
//ProfileTimer.Pop(profileDepth3);
}

View File

@ -2442,6 +2442,15 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _ReplaceWordsInROs, "@ReplaceWordsInROs");
}
}
// C2021-061: For Barakah don't do replace if word is surrounded by " or '
private LazyLoad<bool> _NoReplaceQuoteWords;
public bool NoReplaceQuoteWords
{
get
{
return LazyLoad(ref _NoReplaceQuoteWords, "@NoReplaceQuoteWords");
}
}
private LazyLoad<bool> _UseMetaSections;
public bool UseMetaSections
{