Regular Expressions 101

Community Library

Community Library Entry

-2

Regular ExpressionOpen Workspace

/
<.[^>]*>(\s+|()|(&nbsp;)*|\s+(&nbsp;)*|(&nbsp;)*\s+|\s+(&nbsp;)*\s+)<\/.[^>]*>
/
ig

Description
Created·2014-02-26 13:21
Type·Match
Flavor·PCRE (Legacy)

Removes empty HTML tags. Was needed for old input clean-up and to keep a HTML parses from crashing. Looking for improvement on bottom test.

Submitted by R. Sartorius
Open Workspace