in reply to Using a regex to replace looping and splitting

Would a Map work here? I'm inexperienced with it but my thought is that it will only apply if we do a split on the initial string
Your thought is right: a map needs a list or an array as input, and a simple split on the input data would not help getting the data which would be usable by a map. So, a map would not help much here. You're basically left with a regex to capture everything in one go as shown by tybalt89, or something that is equivalent to two splits and two nested loops.