lib/email_reply_parser.rb
# create regexp for multiline quote headers 
#
# labels - hash of labels
#
# Returns Regexp
create regexp for multiline quote headers
labels - hash of labels

Returns Regexp
create regexp for multiline quote headers labels - hash of labels Returns Regexp
def multiline_quoted_header_regexps(labels)
      quoted_header_regexps = []
      quoted_header_regexps <<  "#{labels[:date]}:.*\n#{labels[:from]}:.*\n#{labels[:to]}:.*\n#{labels[:subject]}:.*"
      quoted_header_regexps << "#{labels[:from]}:.*\n#{labels[:date]}:.*\n#{labels[:to]}:.*\n#{labels[:subject]}:.*"
      quoted_header_regexps << "#{labels[:from]}:.*\n#{labels[:to]}:.*\n#{labels[:date]}:.*\n#{labels[:subject]}:.*"
      quoted_header_regexps << "#{labels[:from]}:.*\n#{labels[:reply_to]}:.*\n#{labels[:date]}:.*\n#{labels[:to]}:.*\n#{labels[:subject]}:.*"
      reverse_regexp("(#{quoted_header_regexps.join("|")})")
    end
def multiline_quoted_header_regexps ( labels ) quoted_header_regexps = [ ] quoted_header_regexps << "#{labels[:date]}:.*\n#{labels[:from]}:.*\n#{labels[:to]}:.*\n#{labels[:subject]}:.*" quoted_header_regexps << "#{labels[:from]}:.*\n#{labels[:date]}:.*\n#{labels[:to]}:.*\n#{labels[:subject]}:.*" quoted_header_regexps << "#{labels[:from]}:.*\n#{labels[:to]}:.*\n#{labels[:date]}:.*\n#{labels[:subject]}:.*" quoted_header_regexps << "#{labels[:from]}:.*\n#{labels[:reply_to]}:.*\n#{labels[:date]}:.*\n#{labels[:to]}:.*\n#{labels[:subject]}:.*" reverse_regexp ( "(#{quoted_header_regexps.join("|")})" ) end
create regexp for multiline quote headers
labels - hash of labels
create regexp for multiline quote headers labels - hash of labels
labels