Thread: Regex examples
View Single Post
Old 01-26-2013, 09:27 AM   #183
Perkin
Fanatic
Perkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Perkin's Avatar
 
Posts: 557
Karma: 23783
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300
Quote:
Originally Posted by MuskratBooks View Post
In Sigil this expression has been helpful:
(“[^”\r\n]*)</p>\s+<p class="calibre.">
Replace with (has a trailing space): \1

This indentifies paragraphs where a opening smart quote is not matched with a closing smart quote and joins that paragraph with the next one. Its not fool proof, but saves a lot of time.

I use calibre conversion to switch straight quotes to smart quotes. Its under "Look Feel", check by "smarten punctuation". Easier to fix its mistakes than to find and fix 'em all.

Good Luck!
You have to be careful, quite a lot of books (especially older ones), have quoted multi paragraphs - usually a long speech, where the closing quotes are missing, because it continues in next paragraph, which (usually) starts with a quote.


In calibre, you can use the 'modify e-pub' plugin that can do the smarten punctuation, without a full conversion.
Perkin is offline   Reply With Quote