Regular Expressions 101

Community Patterns

clean up old line breaks replacing with a closed paragraph </p>and <p>

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(<br><br>|<br\/> <\/br>|<br \/>\s?<br \/>>|<br \/>)
/
gmU

Description

I want to clean up old line breaks replacing with a closed paragraph </p>and an open paragraph <p>. So, <br><br>, or <br/> </br>, or <br /> becomes </p><p>

Submitted by anonymous - 2 years ago