A grammar for parsing the Newick format (roughly based on [3]): Note, "|" separates alternatives.
Sometimes the Name string must be of a specified fixed length; otherwise the punctuation characters from the grammar (semicolon, parentheses, comma, and colon) are prohibited.
The New Hampshire X (NHX) format is an extension to Newick that adds key-value data (gene duplication, etc.)
The brackets are used because they represent comments in the Nexus file format, so any parser not understanding these additional information will ignore them.
Nodes that represent a reticulation event are duplicated, annotated by introducing the # symbol into the Newick format, and numbered consecutively (using integer values starting with 1).
Some programs (e.g. Dendroscope and SplitsTree) allow exactly one copy of the reticulate node to be labeled with ## to indicate that it corresponds to the acceptor edge.
[7] It adds support for: Some other programs, like NWX, uses comments starting with & to encode additional information in an ad hoc manner:[8] Many tools have been published to visualize Newick tree data.