2012-11-27 22:14:05 -05:00
|
|
|
module Gitlab
|
|
|
|
module Regex
|
|
|
|
extend self
|
|
|
|
|
|
|
|
def username_regex
|
|
|
|
default_regex
|
|
|
|
end
|
|
|
|
|
2012-12-25 17:50:41 -05:00
|
|
|
def project_name_regex
|
2012-12-28 02:29:57 -05:00
|
|
|
/\A[a-zA-Z][a-zA-Z0-9_\-\. ]*\z/
|
2012-12-25 17:50:41 -05:00
|
|
|
end
|
|
|
|
|
2013-02-18 02:28:18 -05:00
|
|
|
def name_regex
|
|
|
|
/\A[a-zA-Z0-9_\-\. ]*\z/
|
|
|
|
end
|
|
|
|
|
2012-11-27 22:14:05 -05:00
|
|
|
def path_regex
|
|
|
|
default_regex
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def default_regex
|
|
|
|
/\A[a-zA-Z][a-zA-Z0-9_\-\.]*\z/
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|