Share via


Assert.DoesNotMatchRegex Method

Definition

Overloads

DoesNotMatchRegex(String, String, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

DoesNotMatchRegex(Regex, String, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

DoesNotMatchRegex(String, String, String)

Source:
Assert.Matches.cs

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

public static void DoesNotMatchRegex(string? pattern, string? value, string message = "");
static member DoesNotMatchRegex : string * string * string -> unit
Public Shared Sub DoesNotMatchRegex (pattern As String, value As String, Optional message As String = "")

Parameters

pattern
String

The regular expression that value is expected to not match.

value
String

The string that is expected not to match pattern.

message
String

The message to include in the exception when value MatchesRegex pattern. The message is shown in test results.

Exceptions

value is null, or pattern is null, or value MatchesRegex pattern.

Applies to

DoesNotMatchRegex(Regex, String, String)

Source:
Assert.Matches.cs

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

public static void DoesNotMatchRegex(System.Text.RegularExpressions.Regex? pattern, string? value, string message = "");
static member DoesNotMatchRegex : System.Text.RegularExpressions.Regex * string * string -> unit
Public Shared Sub DoesNotMatchRegex (pattern As Regex, value As String, Optional message As String = "")

Parameters

pattern
Regex

The regular expression that value is expected to not match.

value
String

The string that is expected not to match pattern.

message
String

The message to include in the exception when value MatchesRegex pattern. The message is shown in test results.

Exceptions

value is null, or pattern is null, or value MatchesRegex pattern.

Applies to