src/Str.php
public function matches(string $regex): bool
    {
        if (\func_num_args() !== 1) {
            throw new LogicException('Offset is no longer supported');
        }

        return RegExp::of($regex)->matches($this);
    }
public function matches(string $regex): bool
    {
        if (\func_num_args() !== 1) {
            throw new LogicException('Offset is no longer supported');
        }

        return RegExp::of($regex)->matches($this);
    }
public function matches ( string $ regex ) : bool { if ( \ func_num_args ( ) !== 1 ) { throw new LogicException ( 'Offset is no longer supported' ) ; } return RegExp :: of ( $ regex ) -> matches ( $ this ) ; }
Check if the string match the given regular expression

@param string $regex

@throws Exception If the regex failed

@return bool
Check if the string match the given regular expression