Well understandably the paranethesis matching of this is
extremely difficult. It's my intuition that regex isn't
the right solution-- reformulating the problem is. :) At
the very least, you could just rip out all
s
and get back to single character pairing with nesting. What
strikes me as odd is why the data would even be in that
format to begin with... Surely you could come up with a
more meaningful output format...