Class: Ubi::Memoria::Email

Inherits:
Base
  • Object
show all
Defined in:
lib/ubi/memorias/email.rb

Overview

An Electronic Mail

Instance Attribute Summary

Attributes inherited from Base

#hint, #opts, #text

Class Method Summary collapse

Methods inherited from Base

==, extract_text, #format, inherited, #initialize, key, name, parse, parse!, #parser, plural, #to_s

Constructor Details

This class inherits a constructor from Ubi::Memoria::Base

Class Method Details

.regex(_hint) ⇒ Object

Email regex



13
14
15
16
17
18
19
20
# File 'lib/ubi/memorias/email.rb', line 13

def regex(_hint)
  %r{
    ([a-z0-9!#$%&'*+/=?^_`{|}~-]+
    (?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@
    (?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+
    (?:[a-z0-9-]*[a-z0-9])?)
  }x
end