csUnit Class Library

Assert.EqualsRegex Method (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
);

Parameters

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

Example

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

See Also

Assert Class | csUnit Namespace | Assert.EqualsRegex Overload List