Zend certified PHP/Magento developer

Regex: Find all html tags that contain some other particular html tags

I have some html tags starting with <p class="mb-40px"> and end with </p> The first tag has in it some other tags such as </li> </ul> </div> and spaces and n as you can see.

<p class="mb-40px"></g></svg>               </a>
            </li>
             
        </ul>

    </div>
    </p>

    <p class="mb-40px">Foarte frumos lucru</p>
<p class="mb-40px">I love cars</p>

I want to find and delete all html tags such as the first one that contain </li> </ul> </div>

The Output should be:

    <p class="mb-40px">Foarte frumos lucru</p>
<p class="mb-40px">I love cars</p>

My solution is not good:

FIND: (?=<p class="mb-40px">)[sS]*?</li></div>|</ul>[sS]*?</p>

REPLACE BY: LEAVE EMPTY