$text = preg_replace("/(\<.*?\>)/es", "sprintf(\"<span class=\\\"highlight\\\">%s</span>\", htmlentities('\\1'))", $text);