User:Bookofjude/Regbool/Regbool.php

 * @copyright Copyright 2006, Jude Brown * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */

$wgExtensionFunctions[] = 'wfSetupregbool'; $wgExtensionCredits['parserhook'][] = array(       'name' => 'regbool',        'version' => '0.0.1',        'author' => 'Jude Brown',        'description' => 'adds  function',        'url' => 'http://meta.wikimedia.org/wiki/User:Bookofjude/regbool/regbool.php' );

class Extregbool {

function regboolHook( &$parser, $pattern = , $string =  ) { return @preg_match($pattern, $string); }

}

function wfSetupregbool { global $wgParser, $wgExtregbool;

$wgExtregbool = new Extregbool;

$wgParser->setFunctionHook( 'regbool', array( &$wgExtregbool, 'regboolHook' ) );

}

?>