Commit 4c67be0e authored by Lin Jen-Shin's avatar Lin Jen-Shin

Reuse the possible characters so that we never miss

Feedback:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2112#note_32338043
parent fd7d4c02
module EE
module Gitlab
module Regex
def variable_scope_regex_chars
"#{environment_name_regex_chars}\\*"
end
def variable_scope_regex
@variable_scope_regex ||= /\A[a-zA-Z0-9_\\\/\${}. -*]+\z/.freeze
@variable_scope_regex ||= /\A[#{variable_scope_regex_chars}]+\z/.freeze
end
def variable_scope_regex_message
......
......@@ -39,8 +39,12 @@ module Gitlab
@container_repository_regex ||= %r{\A[a-z0-9]+(?:[-._/][a-z0-9]+)*\Z}
end
def environment_name_regex_chars
'a-zA-Z0-9_/\\$\\{\\}\\. -'
end
def environment_name_regex
@environment_name_regex ||= /\A[a-zA-Z0-9_\\\/\${}. -]+\z/.freeze
@environment_name_regex ||= /\A[#{environment_name_regex_chars}]+\z/.freeze
end
def environment_name_regex_message
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment