Module: IRCd::Utils
- Included in:
- ChannelMode, IRCServer
- Defined in:
- lib/rupircd/utils.rb
Instance Method Summary collapse
Instance Method Details
#channame?(str) ⇒ Boolean
15 16 17 |
# File 'lib/rupircd/utils.rb', line 15 def channame?(str) str =~ /^[#+!\+]/ end |
#correct_nick?(nick) ⇒ Boolean
19 20 21 |
# File 'lib/rupircd/utils.rb', line 19 def correct_nick?(nick) nick =~ /^[a-zA-Z\x5B-\x60\x7B-\x7D][-\w\x5B-\x60\x7B-\x7D]{0,14}$/ end |
#mask_to_regex(mask) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rupircd/utils.rb', line 23 def mask_to_regex(mask) mask = Regexp.escape(mask) mask.gsub!('\*', '.*') mask.gsub!('\?', '.') return Regexp.new('^' + mask + '$') end |