Asserts a string matches a regular expression.

expect('Hello beautiful world!', 'to match', /bea.t.*/);

In case of a failing expectation you get the following output:

expect('Hello world!', 'to match', /beautiful/);
expected 'Hello world!' to match /beautiful/

This assertion can be negated using the not flag:

expect('Hello world!', 'not to match', /beautiful/);

In case of a failing expectation you get the following output:

expect('Hello beautiful world!', 'not to match', /beautiful/);
expected 'Hello beautiful world!' not to match /beautiful/
 
Hello beautiful world!