I have the following line:
{ "diameter":6 } { 60 } {"din":Anchor-1 R 6/5SPx3} {"length":30 } { Impact anchor } {"diameter":6 } { Online:0 } {, de03042 }
I'm trying to remove the following:
- whitespace between each opening and closing braces e.g.
{ "diameter":6 } { 60 }changes to{ "diameter":6 }{ 60 } - Any opened and closed brace that has a number inside it. In this case,
{ 60}will disappear from the output.
I'm using the following pattern but it's not giving the desired output.
s = Regex.Replace(s, @"\s+[{}^]", ""); //Remove whitespace between each element
s = Regex.Replace(s, @"{{ [0-9^}]*}\}", ""); // Remove { 60 }
Desired output:
{ "diameter":6 }{"din":Anchor-1 R 6/5SPx3}{"length":30 }{ Impact anchor } {"diameter":6 }{ Online:0 }{, de03042 }
Current Output:
{ "diameter":660"din":Anchor-1 R 6/5SPx3}"length":30 Impact anchor HPS-1 R 6/5SPx3"diameter":6 Online:0 de03042
Could anyone please point out what's wrong with my patterns?
