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 08-14-2021, 10:06 AM   #1
Paulie_D
Connoisseur
Paulie_D began at the beginning.
 
Paulie_D's Avatar
 
Posts: 67
Karma: 10
Join Date: Apr 2011
Device: Kindle 3, Samsung Tab 4
Regex Function: Italicize a list of words

I have a Saved search that will wrap a designated word in an <i> tag.

This is mainly used for styling ship names where the author has not done so (I'm particular)!

However, doing this one by one seems inefficient to me so I am thinking that if I could create a list of the required words I could just run the function once and it would rattle off all the changes in one go.

All I would have to do is compile the list of words and "Robert is your father's brother".

Unfortunately, my skills with regex functions are, at best, terrible so any assistance would be much appreciated.

FWIW my current Search is

Code:
Find: (Designated String)(?!</i>)([^s(\w)])

Replace: <i>\1</i>\2
Paulie_D is offline   Reply With Quote
Old 08-14-2021, 11:20 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,938
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
(word1|word2|wordn)
The 'pipe' symbol separates the list
grab yourself a REGEX cheat sheet for tips (just remember we use PCRE, so not every thing woiks' that is on the sheet
theducks is offline   Reply With Quote
Advert
Old 08-14-2021, 11:50 AM   #3
Paulie_D
Connoisseur
Paulie_D began at the beginning.
 
Paulie_D's Avatar
 
Posts: 67
Karma: 10
Join Date: Apr 2011
Device: Kindle 3, Samsung Tab 4
Thanks, had not thought of doing it that way with a saved search.

I was thinking more of the regex looking up a list (perhaps in another file) and using that but this will work.
Paulie_D is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help creating possible Regex-Function MerlinMama Editor 14 03-03-2020 05:53 AM
Predefined regex for Regex-function sherman Editor 3 01-19-2020 05:32 AM
regex function replacement The_book Sigil 5 12-09-2019 09:45 AM
Regex question -- All two consecutive words BeckyEbook Sigil 9 02-11-2018 04:55 AM
Regex Function about «» and “” senhal Editor 8 04-06-2016 02:12 AM


All times are GMT -4. The time now is 12:38 AM.


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