Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-04-2020, 12:05 PM   #1
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Getting and using the filename in a regex expression

I want to use the filename to add an id to an expression but I don't know how and I can't find the answer on the web.

For example: I'm in the file name File001.html

I want a function to modify this string: ' ></h1>'
to get this string: 'id="File001"></h1>'
and do it recursively.

Thank you. (I hope I'm in the good forum)

Last edited by jiembe; 04-04-2020 at 12:19 PM.
jiembe is offline   Reply With Quote
Old 04-04-2020, 12:20 PM   #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: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/function_mode.html
kovidgoyal is offline   Reply With Quote
Old 04-04-2020, 01:07 PM   #3
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Thank you.

I should have found it.

Now if only I can find to use it. Try and error will do as always !

(later) Stupidly easy.

Last edited by jiembe; 04-04-2020 at 01:15 PM.
jiembe is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend work the regular expression to filename r2d256 Editor 22 12-26-2015 11:40 AM
Need help with a regex expression MrMcGyver Library Management 3 03-11-2015 04:00 PM
Regular Expression - Adding metadata from filename LMF Calibre 1 03-20-2012 06:46 PM
Help for expression to extract metadata from filename nickflyger Library Management 1 11-13-2011 10:39 AM
What is the default regular expression for filename import? palex481 Calibre 2 03-22-2009 06:11 PM


All times are GMT -4. The time now is 05:52 PM.


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