Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-22-2026, 01:41 AM   #1
gilmorehp
Junior Member
gilmorehp began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2026
Device: none
Replacing text in Sigil

Hi, I know there must be an easy way do do this, i want to replace the following

example:

<p class="class_s9h">sample text sample text</p>

replace with

<p class="text"><i class="italic">sample text sample text</i></p>

I want to keep the original text but change the "class"

what do I put in the find/replace field


Thanks in advance!
gilmorehp is offline   Reply With Quote
Old 05-22-2026, 02:52 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,826
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Find
<p class="class_s9h">(.*?)</p>

Replace
<p class="text"><i class="italic">\1</i></p>
Karellen is offline   Reply With Quote
Advert
Old 05-22-2026, 02:56 AM   #3
gilmorehp
Junior Member
gilmorehp began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2026
Device: none
thanks, but ive tried that in sigil and it wont work. =(
gilmorehp is offline   Reply With Quote
Old 05-22-2026, 03:11 AM   #4
gilmorehp
Junior Member
gilmorehp began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2026
Device: none
Smile

Quote:
Originally Posted by Karellen View Post
Find
<p class="class_s9h">(.*?)</p>

Replace
<p class="text"><i class="italic">\1</i></p>
Thanks! didnt work in sigil but works in calibre.
gilmorehp is offline   Reply With Quote
Old 05-22-2026, 04:32 AM   #5
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,826
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
I thought Sigil used the same flavour of Regex. Maybe a wrong setting in Sigil?
Karellen is offline   Reply With Quote
Advert
Old 05-22-2026, 04:58 AM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 83,491
Karma: 153646249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
[
Quote:
Originally Posted by gilmorehp View Post
Hi, I know there must be an easy way do do this, i want to replace the following

example:

<p class="class_s9h">sample text sample text</p>

replace with

<p class="text"><i class="italic">sample text sample text</i></p>

I want to keep the original text but change the "class"

what do I put in the find/replace field


Thanks in advance!
A very simple thing you can do is use the TagMechanic plugin. You can easily change classes and you could put italic in the CSS. It's really simple with this plugin. I use the calibre version a lot.
Code:
font-style: italic;
Just a quick note, don't do <i class="italic"> that's overdoing it. All you need is <i>.
JSWolf is offline   Reply With Quote
Old 05-22-2026, 06:09 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,457
Karma: 212177022
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Karellen View Post
I thought Sigil used the same flavour of Regex. Maybe a wrong setting in Sigil?
Must not be using the regex search mode. Otherwise, your expression would have worked. There's no difference in how Sigil and Calibre's S&R expressions are parsed.
DiapDealer is offline   Reply With Quote
Old 05-22-2026, 06:15 AM   #8
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: 31,780
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
[



Just a quick note, don't do <i class="italic"> that's overdoing it. All you need is <i>.
How do you know what setting the CSS has in .italic{ } ?

For full paragraphs, I usually give those their own class that has a:
Code:
 font-style: italic;
.
theducks is offline   Reply With Quote
Old 05-22-2026, 06:25 AM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 83,491
Karma: 153646249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by theducks View Post
How do you know what setting the CSS has in .italic{ } ?

For full paragraphs, I usually give those their own class that has a:
Code:
 font-style: italic;
.
I've never seen an <i class="italic"> that in the CSS is nothing but font-style: italic;.
JSWolf is offline   Reply With Quote
Old 05-22-2026, 08:47 AM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,668
Karma: 6774048
Join Date: Nov 2009
Device: many
Yes, if that search did not work, then the user did not set the search to regex mode. Just tried a similar regex in Sigil and it works like a charm.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing text in Sigil Davvy123 Sigil 4 10-03-2018 12:53 PM
Replacing / with correct text ghostyjack Workshop 2 09-11-2013 10:35 AM
Sigil: How to highlight text ? Frank's Sigil 65 12-27-2012 07:37 PM
text problems Sigil? ralphiedee Sigil 14 08-09-2012 04:30 AM
Replacing code without replacing text? ElMiko Sigil 6 11-30-2011 08:14 PM


All times are GMT -4. The time now is 04:24 AM.


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