Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-19-2020, 12:34 AM   #1
sherman
Fanatic
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 578
Karma: 1202637
Join Date: Sep 2008
Location: Auckland - NZ
Device: Kobo Aura H2O, Kobo Forma
Predefined regex for Regex-function

If it doesn't already exist, would it be possible for regex functions to have a predefined rexep that populates the "Find:" field?

I find that the regex-functions I create need to be called with the correct regexp to work. Currently I store it as a comment in the function source, but that gets a bit tedious after a while.
sherman is online now   Reply With Quote
Old 01-19-2020, 03:04 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 36,091
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
doesn't already exist and while i have no problem with this, its not something I want to spend my time on either, so patches are welcome!

And note that saved searches allow you to combine search and replace expressions/functions.

Last edited by kovidgoyal; 01-19-2020 at 03:31 AM.
kovidgoyal is offline   Reply With Quote
Old 01-19-2020, 05:52 AM   #3
sherman
Fanatic
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 578
Karma: 1202637
Join Date: Sep 2008
Location: Auckland - NZ
Device: Kobo Aura H2O, Kobo Forma
Thanks for the reply. If I can figure out how it all works, I might try and submit a PR some time.

Basically, would need to figure out how to obtain a variable, or run a function and update the "Find" field.

I'm assuming the place to start would be src/calibre/gui2/tweak_book/function_replace.py?
sherman is online now   Reply With Quote
Old 01-19-2020, 06:32 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 36,091
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yeah and look in tweak_book/search.py
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
regex function replacement The_book Sigil 5 12-09-2019 10:45 AM
Random number in Regex Function? nqk Editor 2 05-24-2017 12:47 AM
RegEx-Function and hyphenation problem scratch Editor 4 01-28-2017 01:44 PM
Regex Function about «» and “” senhal Editor 8 04-06-2016 03:12 AM
RegEx Function: Title Case phossler Editor 20 12-31-2014 04:19 PM


All times are GMT -4. The time now is 08:35 PM.


MobileRead.com is a privately owned, operated and funded community.