From: Adam Akhtar Date: 2008-03-14T09:34:30+09:00 Subject: Re: use reqex to get the middle character and repeat it ahh why didnt i just think of that... str.gsub(/(\w)(x)(\w)/, '\1'+'\2'*4+'\3') In this situation the string will always be 3 chars long and will either consist of spaces or x so the above will be fine (with a bit of tweaking). Thanks very much! -- Posted via http://www.ruby-forum.com/.