From: Ferdous ara Date: 2012-09-07T19:32:40+09:00 Subject: cant change the string s=`hostname` cluster_name=s.match(/(\w+?)-\w+?-(\d+)/).captures.join.upcase puts cluster_name Result : BD55 but I want if host_name =~ /^BD/ host_name.gsub("BD","DK") puts host_name end so if hostname is BD, it will change it to DK (this number can be change anytime) So End result will be DK55 but its not working Can any one please help me -- Posted via http://www.ruby-forum.com/.