From: sharmin malik Date: 2012-09-10T06:55:30+09:00 Subject: Re: Need help with my logic > unless myname =~ /\A(\w+-v)([khv])(-\d+\..+)\z/ > raise "Bad hostname format: #{myname.inspect}" > end > hosts = [$1+"k"+$3, $1+"h"+$3, $1+"v"+$3] > unless hosts.delete myname > raise "Can't find my hostname #{myname.inspect} to remove from > #{hosts.inspect}" > end > hosts.each do |host| > puts "Please connect to #{host}" > end HI this is nice way to do .. but system hostname is like this (i forgot put -dk ) dk-vk-2.-dk.domain.lan I tried to change the Regix.. but not working Can you please modify it little bit ?? also would be able to explain me little bit how the regix is related to [$1+"k"+$3, $1+"h"+$3, $1+"v"+$3] ?? thanks -- Posted via http://www.ruby-forum.com/.