I have a string containing n substrings in the following format which I want to match:
{varName:param1, param2, param2}
Requirements are as follows:
- Only the varName (inside the curly brackets) is mandatory
- No limit on the number of parameters
- No restrictions on whitespace inside curly brackets apart from var and param names which must not contain whitespace
I would like to be able to capture the varName and each of the parameters separately.
I have come up with a regex that is nearly there, but not quite. Any help would be appreciated.