C# Class Endjin.Assembly.ChangeDetection.Query.Matcher

Partial String matcher class which supports wildcards
Exibir arquivo Open project: endjin/Endjin.Assembly.ChangeDetection

Public Methods

Method Description
MatchWithWildcards ( string filterString, string testString, System.StringComparison compMode ) : bool

Check if a given test string does match the pattern specified by the filterString. Besides normal string comparisons for the patterns *xxx, xxx*, *xxx* which are mapped to String.EndsWith, String.StartsWith and String.Contains are regular expressions used if the pattern is more complex like *xx*bbb.

Private Methods

Method Description
GenerateRegexFromFilter ( string filter, System.StringComparison mode ) : Regex
IsMatch ( string filter, string testString, System.StringComparison compMode ) : bool
IsRegexMatchNecessary ( string filter ) : bool

Method Details

MatchWithWildcards() public static method

Check if a given test string does match the pattern specified by the filterString. Besides normal string comparisons for the patterns *xxx, xxx*, *xxx* which are mapped to String.EndsWith, String.StartsWith and String.Contains are regular expressions used if the pattern is more complex like *xx*bbb.
public static MatchWithWildcards ( string filterString, string testString, System.StringComparison compMode ) : bool
filterString string /// Filter string. A filter string of null or * will match any testString. If the teststring is /// null it will never match anything. ///
testString string String to check
compMode System.StringComparison String Comparision mode
return bool