Community Patterns

Community Library Entry

0

Regular Expression
Created·2023-03-06 10:28
Flavor·PCRE (Legacy)

~
<([A-z0-9-_]+)(([^>"]+"[^"]*")*\s*)/>
~
gm
Open regex in editor

Description

In an HTML will replace all auto-closed tags (/>) with a proper tag closing. It works even if the tag has a closing sign (>) inside an attribute.

Submitted by nabab