lib/mail_address/address.rb in mail_address-1.2.4 vs lib/mail_address/address.rb in mail_address-1.2.5

- old
+ new

@@ -89,14 +89,17 @@ name.gsub!(/(^[\s'"]+|[\s'"]+$)/, '') name.gsub!(/\s{2,}/, ' ') name end - # check if the address is compliant with RFC2822 def self._check_address_with_regex(email_address) return nil unless email_address + # check if the address is compliant with RFC2822 # regex check (see http://blog.livedoor.jp/dankogai/archives/51189905.html) - email_address.match(/^(?:(?:(?:(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+)(?:\.(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+))*)|(?:"(?:\\[^\r\n]|[^\\"])*")))\@(?:(?:(?:(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+)(?:\.(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+))*)|(?:\[(?:\\\S|[\x21-\x5a\x5e-\x7e])*\])))$/) +# email_address.match(/^(?:(?:(?:(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+)(?:\.(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+))*)|(?:"(?:\\[^\r\n]|[^\\"])*")))\@(?:(?:(?:(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+)(?:\.(?:[a-zA-Z0-9_!#\$\%&'*+\/=?\^`{}~|\-]+))*)|(?:\[(?:\\\S|[\x21-\x5a\x5e-\x7e])*\])))$/) + + # permit Docomo/Au address + EMAIL_ADDRESS_ =~ email_address end end end