static BOOLEAN MatchSearchString( _In_ PPH_STRINGREF Input ) { if (SearchRegexCompiledExpression && SearchRegexMatchData) { return pcre2_match( SearchRegexCompiledExpression, Input->Buffer, Input->Length / sizeof(WCHAR), 0, 0, SearchRegexMatchData, NULL ) >= 0; } else { return PhFindStringInStringRef(Input, &SearchString->sr, TRUE) != -1; } }
BOOLEAN WordMatchStringRef( _In_ PPH_STRINGREF Text ) { PH_STRINGREF part; PH_STRINGREF remainingPart; remainingPart = SearchboxText->sr; while (remainingPart.Length) { PhSplitStringRefAtChar(&remainingPart, '|', &part, &remainingPart); if (part.Length) { if (PhFindStringInStringRef(Text, &part, TRUE) != -1) return TRUE; } } return FALSE; }