module Pipio class HtmlLogParser TIMESTAMP_REGEX = /\((?(?:\d{4}-\d{2}-\d{2} )?\d{1,2}:\d{1,2}:\d{1,2}(?: [AP]M)?)\)/ def initialize(source_file_path, user_aliases) # @line_regex matches a line in an HTML log file other than the first. line_regex = /#{TIMESTAMP_REGEX} ?(?.+?) ?(?<AUTO-REPLY>)?:?<\/b> ?(?.+)
/o # @line_regex_status matches a status or event line. line_regex_status = /#{TIMESTAMP_REGEX} ? (?.+)<\/b>
/o cleaner = Cleaners::HtmlCleaner @parser = BasicParser.new(source_file_path, user_aliases, line_regex, line_regex_status, cleaner) end def parse @parser.parse end end end