12-19-2010, 10:43 AM | #1 |
Enthusiast
Posts: 25
Karma: 10
Join Date: Nov 2010
Location: Somewhere in Iowa
Device: Nook Color
|
Need help with a footer
I have been able to remove part of a footer during conversion. The regex builder shows me:
Code:
<b>Page 1</b><br> Code:
<b>Page \d+</b><br> The full header actually is: Code:
<b>Page 1</b><br> <hr> I can get regex to see either line correctly, which will remove either the page number or the blank line. But I have no clue how to get both lines recognized together. Can someone please give me the correct incantation to link these two lines???? |
12-19-2010, 11:06 AM | #2 |
Enthusiast
Posts: 25
Karma: 10
Join Date: Nov 2010
Location: Somewhere in Iowa
Device: Nook Color
|
Jeez ... found my own answer .... looking at the defaults, I found a vertical bar "pipe" character and the old UNIX pile in my head woke up ... tried:
Code:
<b>Page 1</b><br>|<hr> |
Advert | |
|
12-19-2010, 11:56 AM | #3 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
That's one way to do it, the regex will then match either the subexpression on the left side of the pipe or the one on the right side. You could also use something like
Code:
<b>Page\s+\d+</b><br>\s+<hr> Code:
(?s)<b>Page\s+\d+</b><br>.+?<hr> |
04-10-2011, 09:48 PM | #4 |
Enthusiast
Posts: 25
Karma: 10
Join Date: Nov 2010
Location: Somewhere in Iowa
Device: Nook Color
|
What if a line starts with the page number??
I've been working with my eBooks in Caliber for several months now without any problems, but I just ran into something I can't figure out.
The following is a page break for one of my file ... ending and starting text included: Code:
nervously with the other specialists stationed at the <br> 1 <br> <br> <hr> <A name=6></a>end of the runway, waiting for the bombing mission to <br> Code:
+\d+ <br>|<hr>|<A name=+\d+></a> What does one do in this situation??? |
04-10-2011, 10:26 PM | #5 |
Zealot
Posts: 107
Karma: 554
Join Date: Oct 2008
Device: none
|
Normally, I select© everything I want to remove to "Regex:" textbox
Code:
<br> 1 <br> <br> <hr> <A name=6></a> Code:
<br> \d+ <br> <br> <hr> <A name=\d+></a> I think a standalone "+" doesn't do anything and is an error. You should read An introduction to regular expressions and All about using regular expressions in calibre. Last edited by atjnjk; 04-10-2011 at 10:36 PM. |
Advert | |
|
04-11-2011, 10:07 AM | #6 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
The plus sign has special meaning. It means match one or more of of the expression / character before. There is nothin before so it's an invalid expression. If you want to match a plus sign character you need to escape it. Escaping tells the parser to treat it as the character itself.
|
04-12-2011, 01:48 PM | #7 |
Junior Member
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
Hello everyone,
I am also trying to remove page numbers, which in text look like this: Code:
3 <br> Code:
^\d+ <br>$ |
04-12-2011, 01:57 PM | #8 | |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Quote:
2) Use \s instead of a space to match new line characters. Also add + to match multiple spaces. |
|
04-12-2011, 05:41 PM | #9 |
Junior Member
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Kindle
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Footer removal | WilliamDio | Calibre | 2 | 11-26-2010 11:12 AM |
footer removal help | icy | Calibre | 7 | 08-27-2010 01:21 PM |
Removing header and footer | radicalnomad | Calibre | 2 | 08-26-2010 10:34 AM |
Remove Footer | cdecaf | Calibre | 44 | 07-21-2010 05:48 AM |
BookDesigner - Footer font? | moneytoo | Sony Reader | 1 | 10-22-2007 11:31 AM |