Let's say I have a very long string, which essentially are just field names, comma separated.
My problem, when trying to break it into separate fields, is that some names have comma inside them, like "{0,0}" or "{45,-45}" or "{90,90}".
In order to separate this long string into fields I need to replace that comma with something.
This is a small piece of that string: "Normal_0_{0,0}, Normal_90_{45,-45}" - so I need to replace only that comma that inside curly brackets.
So I wrote this:
matches = Regex (longLine, "(\{\d{1,2})(,)(-?\d{1,2}\})", "\1|\3");
It's supposed to replace all the commas inside the string. But in reality it only replaces the first comma in the string.
Why? And how can I replace ALL the matches?
Side question: In this code
Word(1, "Normal_0_{0,0}, Normal_90_{45,-45}" , ", ")
it would split the string by EITHER "," OR " ". How can I split by COMBINATION of characters, specifically split by ", " - comma followed by space?