module Regexp::Syntax

def version_class(version)

def version_class(version)
  return Regexp::Syntax::Any if ['*', 'any'].include?(version.to_s)
  version =~ VERSION_REGEXP || raise(InvalidVersionNameError, version)
  version_const_name = "V#{version.to_s.scan(/\d+/).join('_')}"
  const_get(version_const_name) || raise(UnknownSyntaxNameError, version)
end