(Note: I found a reasonable solution using String.split() instead of Regexp.match(), but I\'m still interested in the theoretical
String.split()
Regexp.match()