Community Patterns

Community Library Entry

0

Regular Expression
Created·2016-02-27 00:59
Flavor·PCRE (Legacy)

/
(\s+)(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?
/
g
Open regex in editor

Description

This regex will find all attributes, values, and the equal operator, as well as the white space between attributes. You can use this to extract all attributes to remove all inline styles.

Submitted by Demetri Ojeda