csUnit Class Library

Assert.EqualsRegex Method (String, String, String)

Compares the given string (actual) against the regular expression. If the expression does not match on the string, then an assertion is raised.

public static void EqualsRegex(
   string actual,
   string expression,
   string message
);

Parameters

actual
The string on which to test the expression
expression
The regular expression to test
message
The user message

Example

Assert.EqualsRegEx("thisismyname1234", "[a-zA-Z]+[0-9]*", "Wrong Format")

See Also

Assert Class | csUnit Namespace | Assert.EqualsRegex Overload List