Useful RegEx commandos for ebook corrections

CommentCategory
Search forReplace with
' to Quotation marks(\w)'(\w)\1\2
closing quotation marks, repeat until none foundQuotation marks(>[^<]*)"( |\)|</i> |</p>|</i></p>|;|<br />|\.|\?)\1«\2
opening quotation marks, repeat until none foundQuotation marks(>[^<]*( <i>|\(| |<p( class="[^"]*")?>|<p><i>))"\1»
... to Punctuation[.,]+[ ]?[.,]+[ ]?[.,]+[ .,]*
Dashes Part 1Punctuation(| - |-{2,})  
Dashes Part 2Punctuation(>[^<]*\w)\1 
Dashes Part 3Punctuation(\w[^>]*<) \1
Dashes Part 4Punctuation- ?(but|and|he|I|yes|oh|she|why|what|Why|What|that|you|You|He|She|of|if|when|because|since|wait|Wait|Well|well|it|It|no|not|even|except|though|Even|Except|Though)   \1 
Remove unnecessary blanks before punctuation marksPunctuation[ ]((\.(?!\d))|([!?,;:«]))\1
strange charactersPunctuation[]\[\\/|°^²~³§{}_´`](?![^<]*>)
to at the beginning of a paragraphPunctuation(<p( class="[^"]*")?>|»||) ?(|-) ?\1
to at the end of a paragraphPunctuation ?(|-) ?(</p>|</i></p>|<br />|«|||\?|\.|!)\2
First LetterHTML<p class="first">(.*?\w)<p class="new"><span class="firstletter">\1</span>
remove unnecessary classesHTML<(em|small|sub|sup|table|tr|td|tbody|body|br|hr|i|b|h[0-9]) [^>]*><\1>
Change TEXT to TextCapitalize(<p class="first">|<h4[^>]*>)(»?)([A-Z])([A-Z -]{2,})\1\2\3\L\4
Suspicious capitalized wordsCapitalize(<p[^>]*>[^<]*\w),? (It|We|When|Why|What|If|Or|And|You|But|Then|He|She|Have|There|At|My|Do|Did|So|A|An|This|That|The|Of) \1. \2 
insert Sigil Chapter BreakMisc<h4<hr class="sigilChapterBreak" /><h4
Search for text outside of HTML tagsMisc(>[^<]*)textold\1textnew
Tag an Monat klebenMisc([0-9][.]) (Januar|Februar|März|April|Mai|Juni|Juli|August|September|Oktober|November|Dezember)\1&nbsp;\2
insert
Graphics<p class="center"><img alt="" height="12" src="../Images/hr.gif" width="100%" /></p>
insert
Graphics<hr />\s*<p><p class="center"><img alt="" height="22" src="../Images/3stars.gif" width="55" /></p>    <p class="new">
insert
Graphics<p class="center"><img alt="The End" src="../Images/TheEnd.gif" /></p>

Often used characters:
@page {margin:8pt;}
body {margin:8pt;}
p {text-indent:1em;margin:0 0 0.4em 0;text-align:justify;orphans:2;widows:2;}
.new,blockquote {text-indent:0;}
.first {text-indent:0;}
.first:first-letter {font-size:175%;line-height:1em;}
.firstletter {font-size:175%;line-height:1em;}
/*.first:first-letter {font-size:235%;display:block;float:left;line-height:1em;margin-right:0.1em;}*/
/*.first:first-line {font-variant:small-caps;font-size:1.1em;}*/
h1,h2,h3,h4,h5,h6,h7,.center {text-align:center;text-indent:0;}
h1,h2,h3,h4 {margin:1em 0 0.5em 0;}
h1,h2,h3 {margin:1em 0 0.5em 0;}
.img {display:block;float:left;margin:0 1em 0em 0em;}
hr {border-style:solid;border-color:grey;width:100%;}
.bold {font-weight: bold;}
.italic {font-style:italic;}
.durchgestrichen {text-decoration: line-through;}
.rite {text-align:right;}
.small {font-size:75%;}
.big {font-size:150%;}
.leftborder {text-indent:0px;margin-left: 20pt;}
.underline {text-decoration: underline;}
.sub {vertical-align: sub;}
.sup {vertical-align: top;}
.pb {page-break-after:always;}
.left {text-align:left;}
.border {border: 1px solid black;border-collapse: collapse;margin: 0.5em;font-size: 0.8em;}
.hundred {width:100%;}
td {vertical-align:top;}
.pb {page-break-after:always;}
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Cover</title>
</head>

<body style="margin:0">
<div><img alt="" height="100%" src="../Images/cover.jpg" width="100%" /></div>
</body>
</html>