Howto: Enable regular expression highlighting in LimeChat

in LimeChat.app/Contents/Resources/logrenderer.rb around line 419… WFM. IANAL. YMMV. RTFM. OMGWTF. WTL. GTFO. ETC.

    words.each do |w|
      next if w.empty?
      s = body
      offset = 0
# 
      rex = Regexp.new(w, true)
# 
      while rex =~ s
# 
        begin
# 
          left = $~.begin(0)
          right = $~.end(0)
          pre = $~.pre_match
          post = $~.post_match
          ok = true

          if exact_word_match
            if !pre.empty? && alphabetic?(w.first_char) && alphabetic?(pre.last_char)
              ok = false
            elsif !post.empty? && alphabetic?(w.last_char) && alphabetic?(post.first_char)
              ok = false
            end
          end

          if ok
            keywords < < { :pos => offset+left, :len => right-left }
          end
          s = post
          offset += right
# 
        rescue
          next
        end
# 
      end
    end

2 thoughts on “Howto: Enable regular expression highlighting in LimeChat

    • apokalyptik says:

      I haven\’t been using LimeChat recently. It\’s not surprising that it doesn\’t work in newer versions, though (they switched from ruby (was it?)) to a compiled app… so you can\’t just go in and make quick changes to the app any longer… which I\’m sure improved performance and stability… but is also a shame for this kind of reason….

Leave a Reply