I'm not especially proud of the code : it's messy, took a long time
and could probably be vastly improved.
I could have used the intersperse iterator method but it's currently in
nightly only. Maybe another way of parsing the string would have prevented
the need ?