Quote:
Originally Posted by Toxaris
You can of course save those searches for reuse...
|
Indeed, I have a large assortment of saved Regex for general EPUB fixing... I try to keep my Saved Regex more for Regex which is used in a large amount of books... not ones that I will use while cleaning one book and never again.
For example, just today I was just working on a book which had bold+italic "subsections" in the format of 'i.' + 'ii." + 'iii.' + ... within the text that I wanted swapped to "(i.)" + "(ii.)" + "(iii.)" + ...:
Quote:
<p><span class="bold">Social Theory and Historical Facts:</span> From the outset, Hayek was well aware <span class="bold italics">a.</span> that “social theory” studies data that are historical in nature, and <span class="bold italics">b.</span> of the issues that are involved. I collate his early comments and observations made before he turned to these wider issues: <span class="bold italics">i.</span> Statistical indices fail to capture key aspects of reality, e.g. changes in the capital structure, <span class="bold italics">ii.</span> Theory provides a framework for fitting in concrete assumptions about people’s actions. <span class="bold italics">iii.</span> Theory studies a constantly-changing object, <span class="bold italics">iv.</span> The trade cycles that have to be explained are historical phenomena, <span class="bold italics">v.</span> In the social sciences, complex phenomena can never be observed twice under identical conditions, <span class="bold italics">vi.</span> The ultimate goal of all economic analysis is, of course, to explain the economic process in time, [i.e.] a chain of historical sequences<a href="#fn29" id="ft29">[29]</a>.</p>
|
So I used:
Code:
<span class="bold italics">([iv]+)\.</span>
Replace:
Code:
<span class="bold italics">(\1.)</span>
I also had regex swapping "ie" + "i.e" + "ie." -> "i.e." and a whole host of others.
You do these Regex fixes as you stumble across them while cleaning other things in the book (making sure footnotes are in proper positions (or that they transferred over properly from the OCR), to make sure sentences are correctly merged, inserting blockquotes, fixing indentation, etc. etc.).
Then let us say I am tweaking a much further section in the book, and I wanted to swap the 'a.' and 'b.' to '(a.)' and '(b.)', I could just easily have had the Regex above in my Search List and tweak it... where in this case, I would have to have retyped it completely from scratch.
Of course this was a simple example I just had in today's EPUB... but many times I run more complex Regex. (and yes yes, I could use the Saved Search to save every Regex I use for every specific book... but that is cumbersome compared to the list if you work at the output level I do).
Perhaps as another addition to Sigil, there should be an option to at least expand the amount of searches saved in the list.