public function matchesRegex(
        $pattern,
        array &$matches = null,
        $flags = null,
        $offset = null
    ) {
        if (null === $flags) {
            $flags = 0;
        }
        if (null === $offset) {
            $offset = 0;
        }

        return 1 === preg_match(
            $pattern,
            $this->string(),
            $matches,
            $flags,
            $offset
        );
    }