public function matches($pattern): bool
    {
        Assert::typeOf(['string', __CLASS__], $pattern);

        return preg_match((string) $pattern, $this->data) === 1;
    }
public function matches($pattern): bool
    {
        Assert::typeOf(['string', __CLASS__], $pattern);

        return preg_match((string) $pattern, $this->data) === 1;
    }
public function matches ( $ pattern ) : bool { Assert :: typeOf ( [ 'string' , __CLASS__ ] , $ pattern ) ; return preg_match ( ( string ) $ pattern , $ this -> data ) === 1 ; }
Checks if this string matches the given regex pattern

@param static|string $pattern
@return boolean
@throws InvalidArgumentException
@throws TypeError
Checks if this string matches the given regex pattern