Regexp Pattern for Importing Wordpress XML into MovableType

The annoyance of non-existent line breaks / line feeds when importing from Wordpress to MovableType has plagued me for some time (see Beware the Line Breaks when Importing from Wordpress to MovableType). I think I may have finally found a solution:

\n(<img|<a|<table|<pre|<blockquote|<ul|<strong|<object|[A-Za-z0-9])

\n<br/><br/>$1

What does this mean? This is a regular expression pattern for matching and replacing text. I’m using it to edit a Wordpress exported xml file before importing it into MovableType. It manually changes the line feeds in each post to br tags. Its a work in progress.

UPDATE: I have another to add now. This one converts the Wordpress pretty permalinks that I used to the default MTOS link structure:

(200.\/..\/)..\/([^\/]+)\/
$1$2.html
By Albert on June 8, 2009 11:16 AM

Categories: