Kyung won Cheon wrote:
> in javascript
> 
> var str = "aaa(xxx)bbb"
> str.replace(/aaa\((.+)\)bbb/, 'AAA(' + '$1' + ')BBB')  // "AAA(xxx)BBB"
> 
> 
> in ruby
> 
> How???

str.sub!(/aaa\((.+)\)bbb/){'AAA(' + $1 + ')BBB'}

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