I need a regEx to remove all ( and ) from a string, except those between two @.
Example:
( [15] == @value 1@ || [15] == @value 2@ ) && ( [5] == @value 3 (ignore these)@ || [5] == @value 4@ ) || ( [2] == @value 5@ )
The string I need:
[15] == @value 1@ || [15] == @value 2@ && [5] == @value 3 (ignore these)@ || [5] == @value 4@ || [2] == @value 5@
I tried something with this non-capturing group to split with whitespaces except those between @ but could not find the way:
(?:@[^@]*@|\S)
I'm under pressure to solve this, any help is appreciated, thank you.