Skip to content

Instantly share code, notes, and snippets.

@SubZane
Last active May 14, 2023 18:02
Show Gist options
  • Save SubZane/3f5206fb439d080a8680 to your computer and use it in GitHub Desktop.
Save SubZane/3f5206fb439d080a8680 to your computer and use it in GitHub Desktop.
Regex to remove empty html tags
<(\w+)\b(?:\s+[\w\-.:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[\w\-.:]+))?)*\s*/?>\s*</\1\s*>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment