Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(?:<style>((?:.*?\r?\n?)*)<\/style>)+|(?:<script>((?:.*?\r?\n?)*)<\/script>)+|(style=\"[^\"]*\")
/
g

Description

Easy remove any <style>, <script> tag and inline styles for clean code

Submitted by Patryk Padus - 7 years ago (Last modified a year ago)