Hi all, first post.
Basically, my site has bbcode style regular expressions.
However, I was wondering if there's a way to call a function on an extracted regular expression?
For example,
<?php
function replacewithfunction($str)
{
$exist = '/\[code lang\=(.*?)\](.*?)\[\/code\]/is';
$replace = geshi_code($1, $2);
$return = preg_replace($exist, $replace, $str);
return $return;
}
?>
Where geshi_code() is the function I wish to call.
Obviously this returns a syntax error, but this is basically what I want do.
Any help would be much appreciated.
Thanks,
Jack.