On Wed, 29 Sep 2004 23:34:25 +0900, STEPHEN BECKER I V
<Becker004 / gmail.com> wrote:
> tr="meet"
> tr.scan(/(.)\1/) {|x| x=x+'x'}   
> print tr
> 
> What I want it to do is find doubles like the ee in meet and put an x
> between them. Am i doing this wrong because x is part of an array now?

You want to use .gsub! instead of .scan. A simple approach:

  tr="meet"
  tr.gsub!(/(.)(\1)/, '\1X\2')
  print tr

Of course if you want "meeet" to become "meXeXet" then the above
won't be good enough and you'll want to use look-aheads to avoid
consuming each following 'e':

  tr="meeet"
  tr.gsub!(/(.)(?=\1)/, '\1X')
  print tr

regards,
andrew