I have data in a non-standard format which I am trying to convert to intelligible json.
Format is like
dataheads@first{
first_data = <value1@123 value2_456 value3_789>;
second_data = <<value4_abc_123 value5_ty>>;};
I need in this step:
first_data = <value1@123,value2_456,value3_789>;
second_data = <<value4_abc_123,value5_ty>>;
I tried Regex.Replace(contents, @"(<.*)\ (.*>)", "$1,$2");
but it only works for a single space between <>. \S*(\s)\S*
messes up data outside <>. I am not sure why <\S*(\s)\S*>
doesn't work. As can be seen, there are a lot more substitutions needed to convert to json so have to be careful not to mess the outsides.