Class Wildcard
- Namespace
- SunamoRegex
- Assembly
- SunamoRegex.dll
Provides wildcard pattern matching built on top of the Regex engine. Cannot be derived directly from Regex because then a wildcard would be passed where a regex is expected. An instance must be created via CreateInstance(string) to ensure proper wildcard-to-regex conversion.
public class Wildcard : Regex, ISerializable
- Inheritance
-
Wildcard
- Implements
- Inherited Members
- Extension Methods
Methods
CreateInstance(string)
Creates a new Regex instance from a wildcard pattern.
public static Regex CreateInstance(string pattern)
Parameters
patternstringThe wildcard pattern to convert and compile.
Returns
CreateInstance(string, RegexOptions)
Creates a new Regex instance from a wildcard pattern with the specified options.
public static Regex CreateInstance(string pattern, RegexOptions regexOptions)
Parameters
patternstringThe wildcard pattern to convert and compile.
regexOptionsRegexOptionsThe regex options to apply.
Returns
IsMatch(string, string)
Determines whether the input string matches the specified wildcard pattern.
public static bool IsMatch(string input, string pattern)
Parameters
inputstringThe input string to match against.
patternstringThe wildcard pattern using * and ? characters.
Returns
- bool
True if the input matches the wildcard pattern; otherwise, false.
WildcardToRegex(string)
Converts a wildcard pattern to an equivalent regular expression.
public static string WildcardToRegex(string pattern)
Parameters
patternstringThe wildcard pattern to convert.
Returns
- string
A regex equivalent of the given wildcard pattern.