summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/regex.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index 0571574aa4f..9f1adc860d1 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -15,20 +15,20 @@ module Gitlab
def namespace_name_regex
- @namespace_name_regex ||= /\A[a-zA-Z0-9_\-\. ]*\z/.freeze
+ @namespace_name_regex ||= /\A[\p{Alnum}\p{Pd}_\. ]*\z/.freeze
end
def namespace_name_regex_message
- "can contain only letters, digits, '_', '-', '.' and space."
+ "can contain only letters, digits, '_', '.', dash and space."
end
def project_name_regex
- @project_name_regex ||= /\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\. ]*\z/.freeze
+ @project_name_regex ||= /\A[\p{Alnum}_][\p{Alnum}\p{Pd}_\. ]*\z/.freeze
end
def project_name_regex_message
- "can contain only letters, digits, '_', '-', '.' and space. " \
+ "can contain only letters, digits, '_', '.', dash and space. " \
"It must start with letter, digit or '_'."
end