From: "Peña, Botp" Date: 2008-03-14T11:14:40+09:00 Subject: Re: use reqex to get the middle character and repeat it # In this situation the string will always be 3 chars long and this is not regex :) irb(main):007:0> RUBY_VERSION => "1.9.0" irb(main):008:0> str='qxq' => "qxq" irb(main):009:0> str[0]+str[1]*4+str[2] => "qxxxxq" or more succinct, irb(main):010:0> str[1]*=4 => "xxxx" irb(main):011:0> str => "qxxxxq" kind regards -botp