Valve/emarsys-broadcast-ruby

View on GitHub
lib/emarsys/broadcast/email.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Emarsys
  module Broadcast
    module Email
      REGEX = /\A(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})\z/i

      def self.validate(email)
        email =~ REGEX
      end
    end
  end
end