-like approach would serve you just as well, if the data appears with one item per-line. Ignoring the braces completely, you can simply look for an identifier, followed by something, followed by a semicolon, grabbing the identifier and the something. (Or, an identifier followed by a left-brace.) Since you know the sequence of the items in the file you can simply process the file line-by-line in this way.