Module: DoorMat::Regex

Defined in:
lib/door_mat/regex.rb

Class Method Summary collapse

Class Method Details

.session_guidObject



12
13
14
# File 'lib/door_mat/regex.rb', line 12

def self.session_guid
  /\A[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\z/
end

.simple_emailObject



4
5
6
7
8
9
10
# File 'lib/door_mat/regex.rb', line 4

def self.simple_email
  # http://tools.ietf.org/html/rfc3696#section-3
  # min 1 char local part and min 2 char domain part
  # max 64 char local part and max 255 char domain part
  # first and last char can not be blank
  /\A\S.{0,63}@.{1,254}\S\z/
end