Not really a BD tip in itself, but an excellent tool for the pre-processing: a very powerful search & replace add-on for OpenOffice Writer. You can get it here:
http://extensions.services.openoffic...ject/AltSearch
Sometimes it is better to use the originaal OO search & replace, sometimes it is best to use the add-on. This add-on was my solution to convert a pdf into a fb2.
Regular expression support is very powerful indeed.