10-25-2009, 05:45 AM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2009
Device: Amazon Kindle 2
|
Multiline Regex Footer
Hey,
since many hours im trying to cut the page number of an ebook with the "footer remove" option. Code:
4 <br> <br> <hr> <A name=5></a> <br> PROLOG <br> <br> I have searched this board and many other regex, but didnt find a solution. My tries so far: Code:
(?m)(( <br>)(<hr>)) Code:
^((\d+ <br>)\n( <br>)\n(<hr>)\n(<A name=\d+</a> <br>))^ Thanks for answers! |
10-25-2009, 09:45 AM | #2 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
Advert | |
|
10-25-2009, 02:46 PM | #3 |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2009
Device: Amazon Kindle 2
|
Thanks for the comment, but i dont get it.
I have tried every possibility i can: Code:
(\d+ <br>(\r\n) <br>(\r\n)<hr>) (\d+ <br>\r\n <br>\r\n<hr>) (\d+ <br>\n <br>\n<hr>) (\d+ <br> <br><hr>)\n ((\d+ <br>)(\r\n)( <br>)(\r\n)(<hr>)) Last edited by hover; 10-25-2009 at 02:48 PM. |
10-25-2009, 04:44 PM | #4 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Hm... try replacing with .+? and see if that makes a difference.
|
10-26-2009, 12:05 PM | #5 |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2009
Device: Amazon Kindle 2
|
thanks but the regex findes the line, if its only 1 line.
But if i go multiline, it doesnt find the 2nd and so on lines.. I have searched for hours and nobody knows how to go multiline with regex |
Advert | |
|
10-26-2009, 12:07 PM | #6 |
creator of calibre
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
10-26-2009, 08:14 PM | #7 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
I've made some changes to where in the conversion process the regex matches to remove the content. Subsequent versions it will work better.
|
10-27-2009, 05:01 AM | #8 |
Junior Member
Posts: 7
Karma: 10
Join Date: Oct 2009
Device: Amazon Kindle 2
|
thanks for the (?m) hint but i still dont get it:
Code:
(?m," <br>\n<hr>") (?m)( <br>\n<hr>) (?m)(( <br>)\n(<hr>)) |
02-02-2010, 11:39 AM | #9 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2009
Device: Sony PRS-505
|
I've got the same task at hand. Matching a multiline footer. Adding "(?m)" to the beginning of the expression doesn't work either. Any ideas?
|
02-03-2010, 03:50 AM | #10 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
I've had quite similar problems.
|
02-03-2010, 04:23 AM | #11 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Given the input
Code:
4 <br> <br> <hr> <A name=5></a> <br> PROLOG <br> <br> |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Structure Detection - Remove Header (or Footer) Regex | DarkKipper | Conversion | 69 | 11-09-2013 12:21 PM |
Regex help to remove HTML footer | neonbible | Calibre | 4 | 09-09-2010 09:42 AM |
footer removal help | icy | Calibre | 7 | 08-27-2010 01:21 PM |
HTML Conversion - Multiline Headers | prky | Calibre | 1 | 07-03-2010 09:24 AM |
Multiline Regex? | prky | Calibre | 25 | 05-01-2010 09:56 PM |