In Ruby 1.9, you could
result = subject.split(/(?<=\})/)
i.e., split the string at a position following a }
. Ruby 1.8 doesn't support lookbehind assertions, though, so it won't work there. And of course you'll be running into problems with nested braces, but you said that this shouldn't be a problem with your data.
In Ruby 1.8 (can't try it here), the following should work:
result = subject.split(/(\})/)
although now the closing braces won't be part of the matched elements anymore. So test {a} test2 {b}
will be split into test {a
, }
, test2 {b
, }
plus an empty string.