to know if an expression has balanced brackets