Parse parenthesis in a string