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