B2026-053-Find-Unlinked-Values-of-Selected

This commit is contained in:
2026-07-28 15:37:37 -04:00
parent 914837a5a2
commit a89c2d3d22
+21 -23
View File
@@ -2078,9 +2078,27 @@ namespace Volian.Controls.Library
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
{
string ROSearchList2 = exactsearch(ROSearchList); // B2026-053 match exact string
// B2022-031 - added a exactsearch to filter out procedure and section titles from global search results.
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, string.Empty, string.Empty);
string byWordPrefix = string.Empty;
string byWordSuffix = string.Empty;
if (Regex.IsMatch(ROSearchList, @"^[\d\.]")) // starts with a number or '.' decimal pt
{
byWordPrefix = @"[^0-9a-zA-Z.vbpi:\\-]";
}
else if (Regex.IsMatch(ROSearchList, @"^[a-zA-Z]")) // starts with a letter
{
byWordPrefix = @"[^a-zA-Z]";
}
if (Regex.IsMatch(ROSearchList, @"[\d\.]$")) // ends with a number or decimal
{
byWordSuffix = @"[^0-9a-zA-Z.vbpi:\\-]";
}
else if (Regex.IsMatch(ROSearchList, @"[a-zA-Z]$")) // ends with a letter
{
byWordSuffix = @"[^a-zA-Z]";
}
string ROSearchList2 = ROSearchList;
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, byWordPrefix, byWordSuffix);
cmbResultsStyleIndex = 3; // display step text in results
}
else
@@ -2190,26 +2208,6 @@ namespace Volian.Controls.Library
}
OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks)));
}
private string exactsearch(string SearchString) // B2026-053
{
StringBuilder ss = new StringBuilder();
int sl = SearchString.Length;
int LstIdxSp = SearchString.LastIndexOf(' ');
if (sl == LstIdxSp + 1) // B2026-053 if ' ' the last char.
{
ss.Append(' ');
ss.Append(SearchString); // B2026-053 add a space prefix to make the search exact if the end of the searchString is a space.
}
else
{
ss.Append(' ');
ss.Append(SearchString); // B2026-053 Exact match add spaces before and after searchString.
ss.Append(' ');
}
return ss.ToString();
}
private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click)
{
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4])