public function match($regex)
    {
        $matches = preg_match($regex, $this->value);
        $message = ['%s {{does not match|matches}} the regular expression %s', $this->value, $regex];
        $this->assert((!empty($matches)), $message);

        return $this;
    }
public function match($regex)
    {
        $matches = preg_match($regex, $this->value);
        $message = ['%s {{does not match|matches}} the regular expression %s', $this->value, $regex];
        $this->assert((!empty($matches)), $message);

        return $this;
    }
public function match ( $ regex ) { $ matches = preg_match ( $ regex , $ this -> value ) ; $ message = [ '%s {{does not match|matches}} the regular expression %s' , $ this -> value , $ regex ] ; $ this -> assert ( ( ! empty ( $ matches ) ) , $ message ) ; return $ this ; }
Assert that the value matches a given regular expression.

@param string $regex A regular expression to match against

@throws AssertionFailureException

@return self
Assert that the value matches a given regular expression .