Determine if the string matches a regular expression pattern.

Twine\Str::matches( string $patern ) : bool

Parameters

$patern A regular expression pattern

Examples

$string = new Twine\Str('john pinkerton');

        $string->matches('/[a-z]+ [a-z]+/'); // Returns true
        $string->matches('/[0-9]+/'); // Returns false