nit: sanity check that the string ends with ']' ?