Regular Expressions 101

Sponsors

Library entries

0
pcre2

HTML Tag Selector

T
Submitted by Rahul - 17 days ago

Clean empty tags from HTML tags incl. tags containing space(s)

Vote

-3

Regular Expression
pcre

/
<([^>\s]+)[^>]*>(?:\s*(?:br \/>| |&nbsp;|&thinsp;|&ensp;|&emsp;|&#8201;|&#8194;|&#8195;)\s*)*<\/\1>
/
gm

Description

Loading markdown...
Submitted by anonymous - 6 years ago