3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\\\\o\{([^}]+)\}/m'; $str = 'hello \\o{test} how are you?'; $subst = '<span>$1</span>'; echo preg_replace($re, $subst, $str); ?>

preferences:
45.37 ms | 402 KiB | 5 Q