View Single Post
Old 04-24-2017, 04:00 AM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by roger64 View Post
The Calibre editor and Sigil offer to store your "saved searches". I know there are some small differences between them about the regex flavor being supported but I am unable to tell precisely which does what.
Sigil uses PCRE and, AFAIK, Calibre Editor uses the regex Python library.

IMHO, PCRE is superior to the Python regex library. Pretty much the only thing that PCRE doesn't support is fuzzy matching. If you happen to need fuzzy matching in Sigil, you can use my unofficial Sigil Python re/regex tester validation plugin to search for strings with fuzzy regex expressions.

If you want to give it a try, open an English book, run the RegexTester validation plugin, select the regex engine and enter the following search expression in the Regex box:

(?:\bwant\b){e<=1}

This'll match want, wants, went, wait etc.

(The matches will be displayed in the validation pane.)

You can control the degree of fuzziness by changing the {e<=1} value. For details see the official regex documentation.

You can, of course, use the same syntax in Calibre Editor to search and replace strings.

BTW, RegexTester is a search-only validation plugin that'll only search the currently selected file(s).

Last edited by Doitsu; 10-23-2021 at 03:50 AM.
Doitsu is offline   Reply With Quote