mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:51:22 +08:00
FIX: email regexp for older rubies
This commit is contained in:
@ -22,7 +22,7 @@ class EmailValidator < ActiveModel::EachValidator
|
||||
end
|
||||
|
||||
def self.email_regex
|
||||
/^[a-zA-Z0-9!#$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-zA-Z0-9!#$%&'\*+\/=?\^_`{|}~\-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/
|
||||
/^[a-zA-Z0-9!#\$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-zA-Z0-9!#\$%&'\*+\/=?\^_`{|}~\-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user