From: Kyung won Cheon [mailto:kdream95 / gmerce.co.kr] 
# in javascript
# var str = "aaa(xxx)bbb"
# str.replace(/aaa\((.+)\)bbb/, 'AAA(' + '$1' + ')BBB')  // 

                             watch out   ^^^^

# "AAA(xxx)BBB"
# in ruby How???

see http://ruby-doc.org/core/classes/String.html#M000831