(([[()])) -> ok ((([](])) -> not ok
Hope OP gets this message.
https://en.wikipedia.org/wiki/Dyck_language
EDIT: The wikipedia article that is.
(([[()])) -> ok ((([](])) -> not ok
Hope OP gets this message.