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 03-19-2014, 08:51 AM   #1
montalex
Addict
montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.
 
Posts: 386
Karma: 517398
Join Date: Mar 2010
Device: Kindle 2i, Kindle Keyboard 3G
Sigil find and replace page numbers

I have a question about removing page numbers in Sigil. I found an epub of "The Sot Weed Factor", which is only available free in an OCRed scanned version. This means that headers have been integrated into the text, so that every page has "The Sot-Weed Factor [xxx]" (where xxx is the page number. It was easy to use "find and replace to get rid of "The Sot-Weed Factor", but the numbers are proving intractable (there are 860 of them).

This is what it looks like:

<p>[ 315 ]</p>

I've tried ever possible version of:

<p>[ \d+ ]</p> or <p>[ (\d+) ]</p>

but nothing works! It seems like the brackets are a problem ( [ ] ). Do you know any solution?
montalex is offline   Reply With Quote
Old 03-19-2014, 09:18 AM   #2
mrmikel
Book Twiddler
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 1,918
Karma: 1405001
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
The brackets are part of regex. To make them a literal character use \ in front of them.
<p>\[\d+\]</p>

Or <p>\[(.+?)\]</p> to remove any thing with brackets around it.

That is my guess. I am not a regex guru.
mrmikel is offline   Reply With Quote
Old 03-19-2014, 09:43 AM   #3
montalex
Addict
montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.
 
Posts: 386
Karma: 517398
Join Date: Mar 2010
Device: Kindle 2i, Kindle Keyboard 3G
Quote:
Originally Posted by mrmikel View Post
The brackets are part of regex. To make them a literal character use \ in front of them.
<p>\[\d+\]</p>

Or <p>\[(.+?)\]</p> to remove any thing with brackets around it.

That is my guess. I am not a regex guru.
To me, you are a regex guru! <p>\[(.+?)\]</p> worked. Phew! That felt good, like trimming a hedge...

Thanks!
montalex is offline   Reply With Quote
Old 03-20-2014, 08:03 AM   #4
mrmikel
Book Twiddler
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 1,918
Karma: 1405001
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
You have to be careful of unintended consequences when you have regex selected without thinking and a period is in the search box. It will select all sorts of stuff other than intended. Thank goodness for the undo button!

It too needs the \ to find it in regex.
mrmikel is offline   Reply With Quote
Old 03-20-2014, 08:40 PM   #5
montalex
Addict
montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.
 
Posts: 386
Karma: 517398
Join Date: Mar 2010
Device: Kindle 2i, Kindle Keyboard 3G
Quote:
Originally Posted by mrmikel View Post
You have to be careful of unintended consequences when you have regex selected without thinking and a period is in the search box. It will select all sorts of stuff other than intended. Thank goodness for the undo button!

It too needs the \ to find it in regex.
Indeed! One of the scripts I tried found and replaced half of the book! Yours only removed page numbers between brackets.

Thanks!
montalex 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
Kindle (AZW3/MOBI) ebooks with "real page numbers" to PDF with same page numbers? abvgd Conversion 2 05-24-2013 01:24 PM
Regex Help: Find page number & Replace+Remove 2x Line Breaks in Sigil Contre-jour Sigil 9 02-01-2013 10:47 AM
Wondering where I can find the "Alice in Wonderland" ePub used on the Sigil home page Jon Westcot Sigil 6 11-13-2012 04:22 AM
Sigil find/replace box LucyLu Sigil 2 05-28-2012 11:33 AM
Sigil Wildcards/Regex Find/Replace Adman35 Sigil 6 05-10-2012 11:04 AM


All times are GMT -4. The time now is 12:09 PM.


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