View Single Post
Old 08-16-2009, 07:52 PM   #11
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by DerSchwarzePrinz View Post
Same effect, only one and three digit numbers are removed. Any ideas?

If I use "\d{1,3}" all the page numbers are removed, but naturally the hyphens stay behind.
If I use "- \d{1,3} -" all page numbers including hyphens are removed without the page numbers that have two digits.
Hm... It could be an extra space somewhere between the -s. As long as there are no spaces between the numbers themselves this should work:

Code:
"-\s*\d{1,3}\s*-"

Quote:
Originally Posted by Spit
I sorted it another way, thanks for the help guys.
Great. As you can tell the header removal is very rough at the moment. Eventually I'm going to write a GUI tool to help. Also, eventually I want to have it auto detect the headers instead of having to use a regex. But both of those are toward the bottom of my todo list.
user_none is offline   Reply With Quote