How to write a regular expression to remove all pairs of curly braces that contain nothing?
For example, {} and {{}} should be reduced to an empty line, but {{} will become { and {{A}{}} become {{A}} .
I am currently executing s/\{\}//g in a loop until the length of the string is fixed, but is there a better way to do this?
regex perl pcre
user5179929
source share