I added a second rectangle as an example starting from a different point, and it never misrecognized any of my rectangles for carets or square brackets again.
Adding left and right parenthesis started messing up with the square brackets, but then I added a couple more of each square and round brackets and it worked perfectly.
Differentiating from lowercase y and g was next to impossible, though...