fix tests and use re for parsing