Checking whether the left and right paranthesis of an expression match