module Cinch::Utilities::String

Public Class Methods

filter_string(string) click to toggle source

@return [String] @todo Handle mIRC color codes more gracefully.

# File lib/cinch/utilities/string.rb, line 8
def self.filter_string(string)
  string.gsub(/[\x00-\x1f]/, '')
end
strip_colors(string) click to toggle source
# File lib/cinch/utilities/string.rb, line 12
def self.strip_colors(string)
  string.gsub(/[\x02\x0f\x16\x1f\x12]|\x03(\d{1,2}(,\d{1,2})?)?/, '')
end