def convert_regexp(target)
      case target
      when Regexp
        target.source
      else
        Regexp.escape(target.to_s.gsub '/', '\/').gsub('\n', '(\r\n|\n)')
      end
    end
def convert_regexp(target)
      case target
      when Regexp
        target.source
      else
        Regexp.escape(target.to_s.gsub '/', '\/').gsub('\n', '(\r\n|\n)')
      end
    end
Do a better job at escaping regexes, handle both LF and CRLF (YAY!)