<?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) );
You have javascript disabled. You will not be able to edit any code.