3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT This is [my_name] and another being <my_name> but this isn't <my_name] because the braces don't match! TEXT; $replacement = 'BOB'; echo preg_replace( '/\[\w+]|<\w+>/', $replacement, $text );

preferences:
57.85 ms | 990 KiB | 5 Q