3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "Hello {replace this curley} {{but not this one}} {{{and not this one}}}"; $formatted = preg_replace('/(?!\{{2,})(\{{1})(\}{1})/'," ",$string); var_dump($formatted);
based on WTcIg
Output for 5.5.0 - 7.3.0alpha1
string(71) "Hello {replace this curley} {{but not this one}} {{{and not this one}}}"