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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-14-2010, 05:37 AM   #1
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Find / replace

Hello, I'm very new to regex. Could I please receive some help with the following within sigil:

<span class="sgc-7">trying</span>

to <i>trying</i>

What would I type in find/replace?

I tried

Find: <span class="sgc-7">(.*)</span>
Replace:<i>(.*)</i)

but did not work. THanks for any help
bremler is offline   Reply With Quote
Old 12-14-2010, 05:55 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Try this:

Search: <span class=\"sgc-7\">(.*)</span>
Replace: <i>\1</i>
HarryT is offline   Reply With Quote
Advert
Old 12-14-2010, 06:10 AM   #3
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Thanks Harry, tried it - but it has only replaced the first tag, not the second. e.g.

<span class="sgc-7">trying</span>

becomes
<i>trying</span>

Also it only replaces one instance when I click on Replace All . . . the sgc-23 tag occurs around 230 times in the html file. More help much appreciate!

Last edited by bremler; 12-14-2010 at 06:17 AM.
bremler is offline   Reply With Quote
Old 12-14-2010, 06:18 AM   #4
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Got it! Clicked in 'minimal matching' and that did the track. Thanks so much :-))
bremler is offline   Reply With Quote
Old 12-15-2010, 06:52 AM   #5
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by bremler View Post
Got it! Clicked in 'minimal matching' and that did the track. Thanks so much :-))
The reason for this is that, without the "minimal matching", the "(.*)" search will include the closing tag (in fact, it will include the whole text of the file from that point onwards. That's also why it was only finding the first instance, of course.), hence it's not being replaced. With the "minimal match", it will stop when it reaches text that matches that specified after the wildcard bit.
HarryT is offline   Reply With Quote
Advert
Old 12-17-2010, 02:14 PM   #6
irishred
Junior Member
irishred began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Dec 2010
Device: Nook
10-22-2010, 02:53 PM #5
HamsterRage
Addict





Posts: 361
Karma: 18008
Join Date: Jun 2010
Device: Kobo
"You can strip that stuff out with Sigil. It takes about 10 seconds."

I have search in Calibre, google and this forum for a very common problem about removing the spam "generated by ABC AMBER Lit converter blah blah blah" from my ebooks. The solutions doesn't always work or create more problems. Now the comment above sounds promising but didn't offer any instructions. Can anyone please help me here. I have spent hours and I am almost at resigned to reading this crap into the ebooks. Thanks!
irishred is offline   Reply With Quote
Old 12-17-2010, 03:26 PM   #7
Ahmad Samir
Zealot
Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!
 
Posts: 114
Karma: 5246
Join Date: Jul 2010
Device: none
(IMHO, it's better to start a new topic and post an example of the text you want to replace).
Ahmad Samir 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
Grep Find & Replace Fabe Sigil 3 12-06-2010 12:00 PM
REGEX find and replace help please potestus Sigil 13 09-18-2010 04:14 PM
find and replace, epub ampsonic Reading and Management 3 03-02-2010 03:20 AM
Crashes on find / replace all mr ploppy Sigil 1 02-03-2010 12:35 PM
Using Find/Replace with BD Otter Sony Reader 7 02-28-2009 01:49 PM


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


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