'PartsRegistry', 'version' => '2006/05/26', 'author' => 'Austin Che', 'url' => 'http://openwetware.org/wiki/User:Austin/Extensions/PartsRegistry', 'description' => 'Enable linking to http://parts.mit.edu/', ); function wfPartsRegistryExtension() { global $wgParser; $wgParser->setHook( "bbpart", "renderPart" ); } function renderPart( $input, $argv ) { $matches = array(); if (preg_match("/(BB.*_)?([-+a-zA-Z_0-9]+)/", $input, $matches)) { $part = strtoupper($matches[2]); if ($matches[1]) $part = $matches[1] . $part; else $part = "BBa_" . $part; return "$input"; } else return ""; } ?>