> b = a.gsub(/\[b\]/,' ')

Also possibly useful is for you:

a = "aaa[b]bbb[b]ccc"
bits = a.split(/\[b\]/)

-- 
Posted via http://www.ruby-forum.com/.