У меня очень длинная строка, состоящая из нескольких HTML документов, скрепленных вместе вот так:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
some head info
</head>
<body>
<div > some content with other HTML tags that I want to preserve </div>
<body>
</html>
<html>
<div> another content with other HTML tags that I want to preserve </div>
</html>
<html xmlns="http://www.w3.org/TR/REC-html40">
<head>
some head info
</head>
<body>
<div> some other content with other HTML tags that I want to preserve </div>
<body>
</html>
, и я хотел бы превратить их во что-то вроде этого:
<div > some content with other HTML tags that I want to preserve </div>
<div> another content with other HTML tags that I want to preserve </div>
<div> some other content with other HTML tags that I want to preserve </div>
В основном я ищу Regex для удаления только тегов <html> </html>
(а не других / внутренних html элементов) из огромной строки html. Обратите внимание, что я должен сохранить содержимое html и просто избавиться от родительских тегов.
Заранее спасибо
(Обратите внимание, что я провел обширный поиск, чтобы убедиться, что это не повторяющийся вопрос)