I have a huge WordPress XML export. Unfortunately, some bastard managed to inject code into the installation and injected DIVs into the content.
Now I want to clean that mess up. Here’s what it looks like:
<p>Normal Text</p>
<div style="position:absolute;top:-9660px;left:-4170px;"><a href="http://insane.link.com">Insane Linktext</a></div>
<div style="position:absolute;top:-2460px;left:-5370px;"><a href="http://insane.link.com">Another Insane Linktext</a></div>
<p>Normal good people's brains' text</p>
I thought about using some regex expression to match the DIVs containing a STYLE attribute. Available tools are Aptana or other TextEditors and a PHP Server as well as a OSX Terminal. Any Suggestions for this?
Thanks and Cheers!
This might help you: It will match the divs that you provided above:
However, it will only match a
div > a > textpattern and only divs that have a style attribute and nothing else.You should be able to do a find-and-replace using most HTML editors (Dreamweaver and Notepad++ both allow it)