Philips interview question

Implement function verify(text) which verifies whether parentheses within text are correctly nested. You need to consider three kinds (),{},<>