public static function pregMatchArray($patterns, $subject)
    {
        if (!is_array($patterns)) {
            throw new \Exception('$patterns is not an array');
        }

        if (!is_string($subject)) {
            throw new \Exception('$subject is not a string');
        }

        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $subject)) {
                return true;
            }
        }

        return false;
    }