fix warning: character class has '-' without escape
This commit is contained in:
parent
52c63918f8
commit
ede695b214
1 changed files with 3 additions and 3 deletions
|
|
@ -9,8 +9,8 @@ module Validation
|
||||||
DIASPORA_ID = begin
|
DIASPORA_ID = begin
|
||||||
letter = "a-zA-Z"
|
letter = "a-zA-Z"
|
||||||
digit = "0-9"
|
digit = "0-9"
|
||||||
username = "[#{letter}#{digit}\-\_\.]+"
|
username = "[#{letter}#{digit}\\-\\_\\.]+"
|
||||||
atext = "[#{letter}#{digit}+\=\-\_]"
|
atext = "[#{letter}#{digit}+\\=\\-\\_]"
|
||||||
dot_atom = "#{atext}+([.]#{atext}*)*"
|
dot_atom = "#{atext}+([.]#{atext}*)*"
|
||||||
no_ws_ctl = '\x01-\x08\x11\x12\x14-\x1f\x7f'
|
no_ws_ctl = '\x01-\x08\x11\x12\x14-\x1f\x7f'
|
||||||
text = '[\x01-\x09\x11\x12\x14-\x7f]'
|
text = '[\x01-\x09\x11\x12\x14-\x7f]'
|
||||||
|
|
@ -20,7 +20,7 @@ module Validation
|
||||||
domain_literal = "\\[#{dcontent}+\\]"
|
domain_literal = "\\[#{dcontent}+\\]"
|
||||||
domain = "(?:#{dot_atom}|#{domain_literal})"
|
domain = "(?:#{dot_atom}|#{domain_literal})"
|
||||||
port = "(:[#{digit}]+)?"
|
port = "(:[#{digit}]+)?"
|
||||||
addr_spec = "#{username}\@#{domain}#{port}"
|
addr_spec = "#{username}\\@#{domain}#{port}"
|
||||||
|
|
||||||
/\A#{addr_spec}\z/u
|
/\A#{addr_spec}\z/u
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue