Table of Contents

Method Matches

Namespace
Xunit
Assembly
xunit.v3.assert.dll

Matches(string, string?)

Verifies that a string matches a regular expression.

public static void Matches(string expectedRegexPattern, string? actualString)

Parameters

expectedRegexPattern string

The regex pattern expected to match

actualString string

The string to be inspected

Exceptions

Thrown when the string does not match the regex pattern

Matches(Regex, string?)

Verifies that a string matches a regular expression.

public static void Matches(Regex expectedRegex, string? actualString)

Parameters

expectedRegex Regex

The regex expected to match

actualString string

The string to be inspected

Exceptions

Thrown when the string does not match the regex