I am using regex to replace p tag if have html attributes with p tag without having attributes and regex is:
$html = preg_replace("/<p[^>]*>(.+?)<\/p>/i", "<p>$1</p>", $html);
Regex is working good if p tag have not any new line like
<p style="text-align: center;">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout</p>
But when p tag have new line then above regex is not working. For an example
<p style="text-align: center;">It is a long established fact that a reader will be
distracted by the readable <br />
content of a page when looking at its layou</p>
So could someone suggest that what changes will be required in above regex so that they work properly if p tag have string including new lines?