Fix greedy matching of brackets and update example