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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-21-2011, 06:24 AM   #1
helmerer
Junior Member
helmerer began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: kindle 3
Search and replace not working

Hi,

at first I would like to thank Kovid Goyal for that great kind of Software!!!

But one issue I've encountered while I tried to remove page numbers from an epub.

The page numbers in the text look like: |10|

My regex for removal is: |[0-9]*|

When I press "Test" in the Wizard it takes a very long time an then the preview dialog shows about 1000000 occurrences. Also no highlights are mark the occurrences.

I've used the regex successfully with notepad++ to remove the page numbers.

Am I doing something wrong or is this a bug?

Best Marco
helmerer is offline   Reply With Quote
Old 02-21-2011, 06:26 AM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,105
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I thought the vertical bar had special meaning in a regex. Have you tried escaping them as \|
itimpi is offline   Reply With Quote
Old 02-21-2011, 06:39 AM   #3
helmerer
Junior Member
helmerer began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: kindle 3
Ok, that does the trick. In other editors I don't have to escape them. Right now it's working.

Thanks for the immediate help :-)
helmerer is offline   Reply With Quote
Old 02-21-2011, 06:41 AM   #4
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I see two issues with your regex: First, as itimpi said, the vertical bar has special meaning, you'll need to escape it. Second, the asterisk as quantifier means "zero or more occurences", try using the plus quantifier, which means "one or more occurences". Thus, your regex should be
Code:
\|[0-9]+\|
Also note that the regex engine used in Notepad++ is decidedly unsimilar to the Python one used in Calibre. For example, Notepad++ doesn't support matching regexes across multiple lines. Use the test facilities Calibre provides if you want to construct a regex for Calibre.
Manichean is offline   Reply With Quote
Old 02-25-2011, 04:48 AM   #5
helmerer
Junior Member
helmerer began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: kindle 3
Ok, I see, I'm not that expert :-) With your help I got i right. Thanks again!!
helmerer 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
Increase search and replace? user_none Conversion 24 04-08-2011 04:59 PM
Search and Replace problem naro_c Conversion 5 02-25-2011 01:59 AM
need regex help search and replace schuster Calibre 4 01-10-2011 10:00 AM
Search and replace in 0.2.0 paulpeer Sigil 7 03-13-2010 12:59 PM
Why no search and replace? charleski Sigil 10 11-24-2009 05:13 PM


All times are GMT -4. The time now is 10:54 PM.


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