From: Justin Gamble Date: 2012-11-01T04:49:32+09:00 Subject: need regex to check for consonants and put number after each consonant Hello, im working on code to check if a character is a consonant or not and if it is to put a number after each one. This is what ive got so far. class Num def to_num( c ) c.each do |c| if c =~ /![aeiou]/ c.join( "0" ) end end end end Num.to_num( "Wow! Look at this get a number after each letter!" ) { |c| print c} I keep getting the undefined method to_num for Num:class Any suggestions on what i can do to get this to work? Any help is appreciated! Thanks! -- Posted via http://www.ruby-forum.com/.