I need to break the following string into seperate 8 seperate groups
"key:val:key:val:key:val:key:val"
I really want to avoid using this ugly regex
([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
So i've tried using a passive group and a quantifier
(?:([^:]*):){1,6}([^\s])+
The problem is that its fine on the Jakarta regex implementation but when its run using the Java implementation I lose the groups. Is there a way of doing this which will work in both cases?
Help would be greatly appreciated! 