def _pv_regex(opts, key, regex)
        value = _pv_opts_lookup(opts, key)
        if value != nil
          passes = false
          [ regex ].flatten.each do |r|
            if value != nil
              if r.match(value.to_s)
                passes = true
              end
            end
          end
          unless passes
            raise ValidationFailed, "Option #{key}'s value #{value} does not match regular expression #{regex.inspect}"
          end
        end
      end
def _pv_regex(opts, key, regex)
        value = _pv_opts_lookup(opts, key)
        if value != nil
          passes = false
          [ regex ].flatten.each do |r|
            if value != nil
              if r.match(value.to_s)
                passes = true
              end
            end
          end
          unless passes
            raise ValidationFailed, "Option #{key}'s value #{value} does not match regular expression #{regex.inspect}"
          end
        end
      end
Check a parameter against a regular expression.