Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2015, 01:32 PM   #1
lockheed
Member
lockheed began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2012
Device: Kindle 3G
Question How to find using wildcards?

I converted a book from PDF to EPUB and using heuristics, the result is great. The only thing is that I have page numbers in middle of text. So I want to remove them all.

In code, all of them look like this:
Code:
<p class="calibre1">25</p>
I wanted to use Find & Replace function to get rid of entire piece of code, but I can't get it to work using wildcards.

I tried
Code:
<p class="calibre1">??</p>
but it doesn't work and Find function doesn't find it.

What should I type in to find every instance of code
<p class="calibre1">..</p>
with any two characters in place of ".."?
lockheed is offline   Reply With Quote
Old 01-06-2015, 01:53 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,939
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Code:
<p class="calibre1">\d+</p>
REGEX mode

\d+ matches only if there are 1 or more digits
theducks is online now   Reply With Quote
Advert
Old 01-06-2015, 03:40 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Regular expressions are NOT wildcard globbing, they are much more powerful, look vaguely similar, and probably confuse a lot of people the first time they see them.

A basic intro to regular expressions might be in order.
http://www.regular-expressions.info

Last edited by eschwartz; 01-06-2015 at 03:43 PM.
eschwartz is offline   Reply With Quote
Old 01-08-2015, 10:45 PM   #4
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
I find the Calibre User Manual write up on regular expressions very readable (and a little entertaining also)

http://manual.calibre-ebook.com/regexp.html
phossler is offline   Reply With Quote
Old 01-08-2015, 11:32 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The calibre writeup is indeed readable, and entertaining as well.

However, http://Regular-Expressions.info has a much more comprehensive writeup, as it is an exhaustive guide, and I find that to be more useful on a personal level.
Additionally, my regex guide of choice has a pretty readable format as well, and I feel no need to switch mental tracks when offering regex suggestions (depending on the complexity of the matter) in order to *patronize* calibre's guide.

At the end of the day, either one can give you a basic rundown on the regex approach, which is what matters.
eschwartz is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil Wildcards/Regex Find/Replace Adman35 Sigil 7 08-16-2014 01:02 PM
Regex/Grep and wildcards John123 Workshop 2 04-12-2014 11:32 AM
More fun with regex / wildcards zelda_pinwheel Sigil 28 01-06-2013 09:57 AM
using wildcards for conversion ? Riiyachan Calibre 7 04-20-2010 10:16 PM
wildcards in sigil bobcdy Sigil 2 12-18-2009 10:19 PM


All times are GMT -4. The time now is 08:30 PM.


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