![]() |
#1 |
Connoisseur
![]() 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 |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |