From: "Jan E." Date: 2012-11-01T05:03:19+09:00 Subject: Re: need regex to check for consonants and put number after each consonant Hi, this cannot work. First of all, to_num() is an instance method and not a class method. You cannot call it on Num, but you'd have to create an instance first and then call it on this object. Secondly, the method doesn't take a block, so the {|c| print c} is useless code. And the method itself also looks strange. You keep overwriting the "c" variable with completely different objects, I'm not even sure what will happen. And the regex syntax is wrong. So you want to put a "0" after each consonant? Then simply use String#gsub: str = 'Wow! Look at this get a number after each letter!' puts str.gsub(/(?<=[bcdfghj-np-tvwxz])/i, '0') -- Posted via http://www.ruby-forum.com/.