Dear Joel, Eric, Jason, Joel(VanderWerf),

Thank you so much for your warm help, with your guide, I can use hash 
method to replace case statement succesfully.

Yes, as Jason noticed, for this case, reg. needed, and not every reg has 
'$' in the end. Also thanks Eric's solution, I know the first time how 
to use reg in the hash.

I still not fully understand Joel VanderWerf's method, I'll go on study 
it, would you give more help if needed? :)

-- 
Posted via http://www.ruby-forum.com/.