C2021-061 BNPPalr & BNPP1 don’t process replace words if they are delimited with “,’ (double & single quote)
This commit is contained in:
parent
c6fd85afd5
commit
3f47ed8825
@ -2122,6 +2122,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
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;
|
||||||
|
// 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));
|
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
|
||||||
//ProfileTimer.Pop(profileDepth3);
|
//ProfileTimer.Pop(profileDepth3);
|
||||||
}
|
}
|
||||||
|
@ -2442,6 +2442,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return LazyLoad(ref _ReplaceWordsInROs, "@ReplaceWordsInROs");
|
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;
|
private LazyLoad<bool> _UseMetaSections;
|
||||||
public bool UseMetaSections
|
public bool UseMetaSections
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user