Mediachase FileUploader.NET 1.9 Framework Help

McHttpModule.PatternMatch Method 

Validate the source string with the specific mask.

[Visual Basic]
Public Shared Function PatternMatch( _
   ByVal Source As String, _
   ByVal Mask As String _
) As Boolean
[C#]
public static bool PatternMatch(
   string Source,
   string Mask
);

Parameters

Source
The string to validate.
Mask
The mask expression.

Return Value

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

Example

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
            

See Also

McHttpModule Class | Mediachase.FileUploader Namespace