in reply to Re^3: Splitting a string based on a regex
in thread Splitting a string based on a regex

This is almost exactly what I came up with apart from the bit about the /g flag. Thanks for your help.