Return to Snippet

Revision: 32152
at September 19, 2010 20:30 by bjornredemption


Initial Code
If you find yourself having to grab content off older websites and have to remove inline styles - or worse inline javascript! - use this code in Dreamweaver's find and replace dialog :


---- for style attribute -----
in the Find box :
(<[^>]*)style\s*=\s*('|")[^\2]*?\2([^>]*>)

in the Replace box :
$1$3

so the following
<a href="http://www.website.com" style="color:red;">Click here</a>
will be reduced to
<a href="http://www.website.com" >Click here</a>


---------
actually you could remove any tag attribute by replacing the 'style' with the name of the attribute you want to remove

Initial URL


Initial Description
Use this regex search in Dreamweaver's find/replace to remove any html tag attributes

Initial Title
Remove html tag attributes with Regex find and replace in Dreamweaver

Initial Tags
regex

Initial Language
Regular Expression