src/Context/ApiContext.php
public function assertResponseBodyMatches(PyStringNode $pattern) {
        $this->requireResponse();
        $pattern = (string) $pattern;

        try {
            Assertion::regex($body = (string) $this->response->getBody(), $pattern, sprintf(
                'Expected response body to match regular expression "%s", got "%s".',
                $pattern,
                $body
            ));
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseBodyMatches(PyStringNode $pattern) {
        $this->requireResponse();
        $pattern = (string) $pattern;

        try {
            Assertion::regex($body = (string) $this->response->getBody(), $pattern, sprintf(
                'Expected response body to match regular expression "%s", got "%s".',
                $pattern,
                $body
            ));
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
public function assertResponseBodyMatches ( PyStringNode $ pattern ) { $ this -> requireResponse ( ) ; $ pattern = ( string ) $ pattern ; try { Assertion :: regex ( $ body = ( string ) $ this -> response -> getBody ( ) , $ pattern , sprintf ( 'Expected response body to match regular expression "%s", got "%s".' , $ pattern , $ body ) ) ; } catch ( AssertionFailure $ e ) { throw new AssertionFailedException ( $ e -> getMessage ( ) ) ; } }
Assert that the response body matches some content using a regular expression

@param PyStringNode $pattern The regular expression pattern to use for the match
@throws AssertionFailedException
@return void

@Then the response body matches:
Assert that the response body matches some content using a regular expression