Skip to content

RegexConstraint

Charlie Poole edited this page Jan 31, 2016 · 7 revisions

RegexConstraint tests that a pattern is matched.

Constructor

```C# RegexConstraint(string pattern) ```

Syntax

```C# Does.Match(string pattern) Matches(string pattern) ```

Modifiers

```C# ...IgnoreCase ```

Examples of Use

```C# string phrase = "Make your tests fail before passing!"

Assert.That( phrase, Does.Match( "Make.*tests.*pass" ) ); Assert.That( phrase, Does.Not.Match( "your.*passing.*tests" ) ); Expect( phrase, Matches( "Make.*pass" ) );


<h4>Notes</h4>
1. <b>Matches</b> may appear only in the body of a constraint 
   expression or when the inherited syntax is used.
Clone this wiki locally