I am trying to write a regex to validate and extract the values from a colon separated string that can have 1-4 values. I have found example where there are a fixed number of variables and tried to use this but it only picks up the first and last values, I need to extract all of them. The current regex is also including the : in the match, I simply want the value if possible
I am currently using this;
^([01ab])+(\:[01ab])*
but it only pulls the first and last values, not those in between if they exist.
Valid values;
0
0:a
0:a:1
0:1:a:b
Not valid
0:a:
0:a:1:b: