3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '{Company X Inc.|CVR-1-81287283} was recently acquired by {Company Z Inc.|CVR-1-34251568}'; var_export( preg_replace('~\{([^|]+)\|([^}]+)}~', '<a href="companies/$2">$1</a>', $string) );

preferences:
136.13 ms | 405 KiB | 5 Q