I would like to separate a dot delimited string into its component parts using regex.
I can build something that captures the first example, but struggling to find out how to get the pattern to recurse.
The source string is something like
all.cats.like.chicken
I would like the output to be (in this case) four capture groups
1: all
2: cats
3: like
4: chicken
I have this pattern that will return the first and second elements
(/\w*)(?:\.(\w*)) (i.e. 1:all 2:cats)
And this version will return the first and last elements
(\w*)(?:\.(\w*))+ (i.e. 1:all 2:chicken)
How do I modify (or replace!) this to get all the terms?
Thanks in advance for whatever help you can provide.