Quote:
Originally Posted by library addict
I apologize if this has been aswered, but I can't find it.
I have a book in ePub where the space before every italicized word is missing. I've tried using search & replace, but simply having <span class="italic"> in the search field and
<span class="italic"> and pressing the space bar in the replace field does not work.
I tried typing
<span class="italic">[a-zA-Z]
in the search field and
<span class="italic"> [a-zA-Z]
in the replace field, but while this finds all of the instances on the test screen, it actually adds "[a-zA-Z]" before every italicized word.
I'm sure there's something simple I am overlooking. I was able to remove all the headers and footers from my PDFs with trial and error, but that was before the Search and Replace feature was implemented. And whatever I'd learned then about regular expressions I have obviously forgotten.
Any help would be greatly appreciated.
|
You have to use backreferences for that to work. Try searching for
Code:
(?P<markup><span class="italic">)(?P<character>[a-zA-Z])
and replacing with
Code:
\g<markup> \g<character>
(I'm using named backreferences here for the purpose of clarity.) If you want to, there's also a tutorial for regular expressions
available, although it's aimed at beginners.