I'm working on a migration from Drupal to WP. The database conversion and import went smoothly, but there is a lot of 'crap' in each post content such as divs with inline styles. Basically, in each post (over 800 of them) I need to sort through them, remove all div tags but keep the actual content between the div tags.
Examples A post with content like this:
<div class="contentHeader" style="clear: both; min-height: 40px; margin: 12px 0px 9px 9px; color: #f16000; font-family: Arial; font-size: 16px; font-weight: bold; text-align: left;">
<div class="title entry-title" style="font-family: Arial; font-size: 24px; line-height: 22px; color: #f16000;"><span style="font-size: 13px; color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;">Dear Neil: I am 55, and find myself single all over again. Trying to find a relationship is radically different than it was when I was in my 20s. I want to remarry, but it's harder to date at this age, and it is very difficult to evaluate whether someone would be compatible with me. I know I'm not as “hot” as I used to be, and the people I'm meeting aren't likely to win “sexiest man alive” contests anytime soon as well. Is there anything that could help me evaluate whether someone is a good potential intimate partner for me? There are millions of us in the second half of our lives trying to find each other. Can you help?</span>
<div class="articlemain" style="min-height: 1365px; color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; text-align: left;">
<div class="hnews hentry item">
<div class="content" style="font-size: 13px; padding: 17px 0px 17px 9px;">
<div class="entry-content">
<div class="articleparagraph">More content.....
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I need to run some sort of script (with regex?) that will remove the 'crap' but keep the text between div and span tags :
Dear Neil: I am 55, and find myself single all over again. Trying to find a relationship is radically different than it was when I was in my 20s. I want to remarry, but it's harder to date at this age, and it is very difficult to evaluate whether someone would be compatible with me. I know I'm not as “hot” as I used to be, and the people I'm meeting aren't likely to win “sexiest man alive” contests anytime soon as well. Is there anything that could help me evaluate whether someone is a good potential intimate partner for me? There are millions of us in the second half of our lives trying to find each other. Can you help?
More content.....
Any ideas on the best way to accomplish this? Help is greatly appreciated.

code<?php ob_start(); the_content(); $old_content = ob_get_clean(); $new_content = strip_tags($old_content); echo $new_content; ?>code– Derek Feb 20 at 21:08