$content="[
{bunches of data}, {more data}, {etc},
{hey more data}, {etc}, {etc},
{etc}, {etc}, {etc}]";
while ( $content =~ /(.*)\
(\{.*?\})\/)
{
print "$2\n";
$content =~s/(.*)\
\{(.*?)\}\/$1\!\{$2\}\!/;
}
It will search the deep inner text first and so on. The output come like
{etc}, {etc}, {etc}
{hey more data}, {etc}, {etc}
{bunches of data}, {more data}, {etc}
Regards,
Deva