Class WildcardUtil
Provides wildcard pattern match.
Inheritance
System.Object
WildcardUtil
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data.Meta.Management
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 13.30.0Syntax
public static class WildcardUtil
Methods
PatternMatch(String, String)
Validate the source string with the specific mask.
Declaration
public static bool PatternMatch(string Source, string Mask)
Parameters
Type | Name | Description |
---|---|---|
System.String | Source | The string to validate. |
System.String | Mask | The mask expression. |
Returns
Type | Description |
---|---|
System.Boolean | true if the Source string are valid; otherwise, false. |
Remarks
The static PatternMatch method allow you to validate your string with the specific mask.
The PatternMatch mask expression allows you to use two basic character types: literal (normal) text characters and metacharacters.
Metacharacters used to ? and * characters.
? | Match any simbol |
* | Zero or more matches |
Examples
The following code illustrates the use of the PatternMatch method.
bool bRet1 = McHttpModule.PatternMatch("text","*"); // return true
bool bRet1 = McHttpModule.PatternMatch("text","*e?t"); // return true
bool bRet1 = McHttpModule.PatternMatch("text","*exx"); // return false
bool bRet1 = McHttpModule.PatternMatch("text","t?et"); // return true
bool bRet1 = McHttpModule.PatternMatch("text","??e?"); // return false
bool bRet1 = McHttpModule.PatternMatch("text","t*t*"); // return true