Ahh, people are trying to do a replacement before finding tokens. I wondered why so many people were saying this was difficult.
My head went straight to token parsing, which given the limited set of tokens made it trivial. Thought I was missing something