gitlab-org--gitlab-foss/lib/gitlab/regex.rb
2013-08-13 12:24:10 +03:00

27 lines
379 B
Ruby

module Gitlab
module Regex
extend self
def username_regex
default_regex
end
def project_name_regex
/\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/
end
def name_regex
/\A[a-zA-Z0-9_\-\. ]*\z/
end
def path_regex
default_regex
end
protected
def default_regex
/\A[a-zA-Z0-9][a-zA-Z0-9_\-\.]*\z/
end
end
end