Almost working.

But now I know how to do it right. :)
Much better but still needs a little work.
Corner case
There we go, escaped brackets.