04-24-2017, 02:38 AM | #1 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Clarification about regex "flavor"
Hi
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. On the other hand there are also excellent sites for training and testing purposes like https://regex101.com/. Is the latter compatible with either Sigil or Calibre? It offers (among several other flavors) a PCRE option. |
04-24-2017, 04:00 AM | #2 | |
Grand Sorcerer
Posts: 5,599
Karma: 23164939
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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. |
|
Advert | |
|
04-24-2017, 05:17 AM | #3 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Doitsu
Thank you very much for such a documented answer. I'll keep it as a reference. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
regex "?" with higher priority greedynes then the previous "?" ? | user743 | Editor | 1 | 05-04-2014 03:57 AM |
[Old Thread] Regex "FN LN" to "LN, FN" & reverse? | unboggling | Library Management | 19 | 11-20-2013 06:44 AM |
Samsung Galaxy Tablet in 10" flavor | Sonist | News | 1 | 08-21-2010 03:11 PM |
Display 2008: E-Paper in "57 flavor-packed varieties" / FLEPia still pricy | Alexander Turcic | News | 5 | 04-17-2008 01:39 PM |