s = "^foo{bar}@Something_Else"puts s.gsub(/(.*)\^\w+\{([^}]+)}(.*)/, '\1SOMETHING ELSE\2\3')
Standard input is empty
SOMETHING ELSEbar@Something_Else
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!