def matches_mask(mask, string, casemapping = :rfc1459)
      if mask =~ /\$/
        raise ArgumentError, "Extended bans are not supported"
      end
      string = IRCSupport::Case.irc_upcase(string, casemapping)
      mask = Regexp.quote(irc_upcase(mask, casemapping))
      mask.gsub!('\*', @@mask_wildcard)
      mask.gsub!('\?', @@mask_optional)
      mask = Regexp.new(mask, nil, 'n')
      return true if string =~ /\A#{mask}\z/
      return false
    end
def matches_mask(mask, string, casemapping = :rfc1459)
      if mask =~ /\$/
        raise ArgumentError, "Extended bans are not supported"
      end
      string = IRCSupport::Case.irc_upcase(string, casemapping)
      mask = Regexp.quote(irc_upcase(mask, casemapping))
      mask.gsub!('\*', @@mask_wildcard)
      mask.gsub!('\?', @@mask_optional)
      mask = Regexp.new(mask, nil, 'n')
      return true if string =~ /\A#{mask}\z/
      return false
    end
Match strings to an IRC mask.
 @param [String] mask The mask to match against.
 @param [String] string The string to match against the mask.
 @param [Symbol] casemapping The IRC casemapping to use in the match.
 @return [Boolean] Will be true of the string matches the mask.