Help with regexp
Hi,
Can somebody help me build a regexp for the following Search and (maybe) Replace problem?
I have some PDF books I've converted to AZW3 to use on my Kindle Oasis. The conversion process works fine, but there are some problems in the converted files, which, I think, I have to correct manually: some of the sentences are split into several parts, by the the conversion module. I can see this in the HTML files, there are two strings, one constant and one dynamic, that appear, sometimes, in the middle of a sentence. Usually, if I replace these strings with a blank, I correct the split problem. The problem is that these strings appear in many places in the HTML files, where they are needed, so I can't replace all of them with blanks. That's why, I think, I have to do the Replace part manually, but I would like to find all occurrences of both strings in only one search operation and decide if the replacement is needed at that position in the HTML file.
I'm new to Calibre and I don't know Python, but I would like to build a search expression to replace, if needed, the following strings:
</p> <p class="calibre1"> (this string is not a problem to find and replace because it is not changing)
OR
</p> <p class="calibre1"><a id="p128"></a> (this string is dynamic, the number after the "p and its number of digits change).
So, I would like to use this expression in the calibre editor, with the Find and Replace module, probably in Mode Regex, to find all occurrences of these strings and eventually replace them with a space.
Any help will be much appreciated.
Thank you in advance,
Daniel
|