253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
# File 'lib/formkeeper.rb', line 253
def build_regexp
wsp = '[\x20\x09]'
vchar = '[\x21-\x7e]'
quoted_pair = "\\\\(?:#{vchar}|#{wsp})"
qtext = '[\x21\x23-\x5b\x5d-\x7e]'
qcontent = "(?:#{qtext}|#{quoted_pair})"
quoted_string = "\"#{qcontent}*\""
atext = '[a-zA-Z0-9!#$%&\'*+\-\/\=?^_`{|}~]'
dot_atom_text = "#{atext}+(?:[.]#{atext}+)*"
dot_atom = dot_atom_text
local_part = "(?:#{dot_atom}|#{quoted_string})"
domain = dot_atom
addr_spec = "#{local_part}[@]#{domain}"
dot_atom_loose = "#{atext}+(?:[.]|#{atext})*"
local_part_loose = "(?:#{dot_atom_loose}|#{quoted_string})"
addr_spec_loose = "#{local_part_loose}[@]#{domain}"
addr_spec_loose
end
|