3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(?:\[[^][]*]|\([^()]*\)|{[^{}]*})(*SKIP)(*F)|[^][(){}]+/m'; $str = 'Hello [123] {45} world (67) Hello There (8) [9] {0}'; $result = preg_replace($re, '', $str); echo $result;

preferences:
65.68 ms | 404 KiB | 5 Q