Hi I'm trying to create a Regex to help separate a string into a series of object fields, however having issues where the individual field values themselves are lists and therefore comma separated internally.
string = "field1:1234,field2:[[1, 3],[3,4]], field3:[[1, 3],[3,4]]"
I want the regex to identify only the commas before "field2" and "field3", ignoring the ones separating the list values (e.g. 1 and 3, ] and [, 3 and 4.
I've tried using non-capturing groups to ignore the character after the commas (e.g. (,)([?!a-z]) ) but given I'm running this in Kotlin I don't think non-capturing and group separation is useful.
Is there a way to ignore string values between specified characters? E.g. ignore anything between "[[" and "]]" would work here.
Any help appreciated.