mirror of
https://github.com/tildeclub/welcome.git
synced 2026-01-24 01:20:18 +00:00
Merge pull request #5 from shrubberytilde/email-regex
Update email regex to use Ruby stdlib
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
require "etc"
|
||||
require "tty-prompt"
|
||||
require "tty-screen"
|
||||
require "uri"
|
||||
|
||||
def sep
|
||||
puts
|
||||
@@ -128,7 +129,7 @@ puts
|
||||
|
||||
if prompt.yes?(" would you like to forward your mail elsewhere?")
|
||||
forward_addr = prompt.ask(" where would you like to forward your mail to?") do |q|
|
||||
q.validate(/\A\w+@\w+\.\w+\Z/)
|
||||
q.validate(URI::MailTo::EMAIL_REGEXP)
|
||||
q.messages[:valid?] = "Invalid email address"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user