3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text='this PART should be CONVERTED to uppercase [This PART should not BE changed] this part should also be CONVERTED to uppercase [THIS part should also not be CHANGED] etc..'; $text = preg_replace_callback( "/(\[(.*?)\])(*SKIP)(*FAIL)|\w+/is", function($m) { return strtoupper($m[0]); }, $text); echo $text;

preferences:
101.58 ms | 1524 KiB | 5 Q