Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2015-07-03 22:32
Flavor·PCRE (Legacy)

/
\<(\w+)\s[^>]*?style=([\"|\']).*?\2\s?[^>]*?(\/?)>
/
gmi
Open regex in editor

Description

This one removes ALL attributes if "style" is found. See my other expression to only remove the style.

Submitted by socialblogsitewebdesign.com