- preg_replace_callback: documentation ( source)
<?php
$line="This is the first test [paragraph]{@font-face:Garamond}";
$line=preg_replace_callback('/\[([\w\s]*)\]{([\w\s\\@:=\'"-\.;^}]*)}/',
function($match){
/*$inline=new Element('span');
$inline->html($match[1]);
$this->_applyDeclaration($inline,$match[2]);*/
return 'foo';
},
$line);
echo $line;