Start of re-write to remove regex.
More re-writing the parser to remove regex.