Python: preg_replace analog function
I have a litle expression in PHP:
$search = array("'<(script|noscript|style|noindex)[^>]*?>.*?</(script|noscript|style|noindex)>'si", "'<\!--.*?-->'si", "'<[\/\!]*?[^<>]*?>'si", "'([\r\n])[\s]+'"); $replace = array ("", "", " ", "\\1 "); $text = preg_replace($search, $replace, $this->pageHtml); How did i do this in python? re.sub ?
+4
1 answer