Example1: test1:test2:test3:test4
would be broken into 4 groups.
test1
test2
test3
test4
Example2: 123:abc
would be broken into just 2 groups.
123
abc
Is this possible? Thanks, Chris
Yes, quite simple actually:
/([^:]+)/
I hope that is what you meant :)
UPDATE
After you refined your answer, you mean you want multiple groups on one match. This is contrary to how you would normally use a regex (and you are probably aware of that), but with the given limitations of your tool, the best you can do is a finite set of groups, which you have to read from your first match.
I am not familiar with the tool you use, so I can't say for sure if it won't produce any negative side-effects, but this would be the closest you could get. Example for maximum of 8 groups:
([^:]+)?:?([^:]+)?:?([^:]+)?:?([^:]+)?:?([^:]+)?:?([^:]+)?:?([^:]+)?:?([^:]+)?
A proper solution that deals with indefinite groups would not work unfortunately. You need to manually create matching groups. Simply duplicate the following for as many groups as you need (max):
([^:]+)?:?
It is ugly but might just work.
If you need this completely dynamic, however, that is not possible.