Thread: Regex examples
View Single Post
Old 12-11-2018, 09:32 PM   #557
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Leonatus View Post
I'm at a book where quotations are marked by right- (opening) and left-pointing double angle quotes (» and «).

First problem: Frequently, in the middle of direct speech marked as reported, there are citations that are as well marked by right- and left-pointing double angle quotes. I would like to replace those citations by single angle quotes. Is there a good way to find them (only in the middle of direct speech, not outside)?
Which language are you working in? Slovak?

There was a similar thread in the Calibre Editor subforum discussing guillemets:

Regex Function about «» and “”

where I posted a very basic Regex I use. senhal posted his in Post #9.

You may just have to flip around some of the inner/outer »« directions, and substitute in some ›‹, but the logic should all be the same.

Note: And I still stand by Toxaris's EPUBTools Dialogue Checker being the best tool for this job. This problem really requires something a bit smarter than just Regex.

Quote:
Originally Posted by Leonatus View Post
Second problem: It appears, that at direct speech passages, there is an opening double angle, but the closing one is missing (by error of OCR, perhaps). How can I find (and replace) such items, please?
Edit: Sometimes it's vice-versa: the closing mark is there, but the opening one is missing.
Like BetterRed said, English has an opening quote across multiple paragraphs if it's the same character talking:

Quote:
Sue continued to drone on, “This is a very long example. [...] And she keeps talking.
“And talking.
“And talking.
“And talking until the roosters crow.”
I am not too sure if other languages follow a similar "no closing quote" rule.

Last edited by Tex2002ans; 12-11-2018 at 09:43 PM.
Tex2002ans is offline   Reply With Quote