02-21-2011, 05:24 AM | #1 |
Junior Member
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 |
02-21-2011, 05:26 AM | #2 |
Wizard
Posts: 4,552
Karma: 950151
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 \|
|
Advert | |
|
02-21-2011, 05:39 AM | #3 |
Junior Member
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 :-) |
02-21-2011, 05:41 AM | #4 |
Wizard
Posts: 3,130
Karma: 91256
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]+\| |
02-25-2011, 03:48 AM | #5 |
Junior Member
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!!
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Increase search and replace? | user_none | Conversion | 24 | 04-08-2011 03:59 PM |
Search and Replace problem | naro_c | Conversion | 5 | 02-25-2011 12:59 AM |
need regex help search and replace | schuster | Calibre | 4 | 01-10-2011 09:00 AM |
Search and replace in 0.2.0 | paulpeer | Sigil | 7 | 03-13-2010 11:59 AM |
Why no search and replace? | charleski | Sigil | 10 | 11-24-2009 04:13 PM |