public static function isMatch($value, string $pattern): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        return !!preg_match($pattern, (string) $value);
    }
public static function isMatch($value, string $pattern): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        return !!preg_match($pattern, (string) $value);
    }
public static function isMatch ( $ value , string $ pattern ) : bool { if ( ! static :: isStringCastable ( $ value ) ) { return false ; } return ! ! preg_match ( $ pattern , ( string ) $ value ) ; }
Checks if value matches a regular expression

@param mixed  $value   The value
@param string $pattern The regex pattern

@return bool
Checks if value matches a regular expression