How to bulk remove html-blocks in multiple files?

I need to administer dozens of sites on pure html. Sometimes I need to change on several sites a pieces of code with many spaces, tabs and special characters, like this:

    <div class="one">
        <div class="two second bla-bla">
            <p>bla bla bla</p>

            <p>some text</p>
            <div class="someclass">Text<div>

<script>some code</script>

with this:

<div class="bla">
    <script>some code</script>

What is the easiest and fastest way to make these changes? In thousands of files, using regular expressions and with the most user-friendly interface.

I used to do this: download all the html files and use "Search and Replace" with regular expressions in Sublime Text.

Then I tried sed. The problem was that shielding all the spaces and tabs was difficult. I regularly make mistakes due to the difference in whitespace. It is also difficult to use regular expressions.

Is there a simpler solution?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum