]+>.+?'.
'http://www.youtube.com/v/([A-Za-z0-9\-_]+).+?#s';
$pre_replace = '\1';
return preg_replace($pre_regex, $pre_replace, $html);
}
public function postFilter($html, $config, $context) {
$post_regex = '#([A-Za-z0-9\-_]+)#';
return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html);
}
protected function armorUrl($url) {
return str_replace('--', '--', $url);
}
protected function postFilterCallback($matches) {
$url = $this->armorUrl($matches[1]);
return '';
}
}
// vim: et sw=4 sts=4