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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-09-2011, 07:53 AM   #1
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 15,137
Karma: 13495770
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Regex question and maybe some help

I have built a regex to find paragraphs not ended by a normal terminal (eg. . ! etc) which may be a broken paragraph.

Code:
[^".;!:']</p>
Being the regex guru - - that I am, there is a problem. The regex works fine except it does not ignore (").

It allows me to look at each find and determine if it is truly a broken paragraph.

How do I get this thing to ignore the (")?
crutledge is online now   Reply With Quote
Old 03-09-2011, 09:37 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,100
Karma: 4571547
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Depending on the regexp dialect, this might work:

Code:
[^.:!?"']["')]?</p>
(assuming you meant ? instead of ; and you allow closing parenthesis as a paragraph end). The ? outside the brackets matches zero or one occurrence of the previous expression.

Last edited by Jellby; 03-10-2011 at 04:34 AM.
Jellby is offline   Reply With Quote
Old 03-09-2011, 11:03 AM   #3
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
Posts: 60
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
Could the problem be that you need to specify both straight quotes and curly ending quotes? If so you'd need to copy and paste the required type of quote into the expression.
Faster is offline   Reply With Quote
Old 03-09-2011, 04:53 PM   #4
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 15,137
Karma: 13495770
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by Faster View Post
Could the problem be that you need to specify both straight quotes and curly ending quotes? If so you'd need to copy and paste the required type of quote into the expression.
i got everything working fine, thank you.
crutledge is online now   Reply With Quote
Old 03-10-2011, 07:15 AM   #5
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,774
Karma: 1089170
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Kindle Fire HDX 8.9 , Kindle for PC
every approach has exceptions. my normal fix fails on things like
T.V.
show

or
L.A. district

where the full stop is not actually a sentence end, but has been followed by a line feed.

to be thorough takes 2 passes. 1 to check for sentence ends , then another to check for paras which begin with lower case letter.
cybmole is offline   Reply With Quote
Old 03-10-2011, 08:13 AM   #6
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
@cybmole, that still wouldn't get them all.

What about when it's something like Mr.
Smith, that wouldn't get caught.
Perkin is offline   Reply With Quote
Old 03-10-2011, 08:28 AM   #7
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 2,774
Karma: 1089170
Join Date: Sep 2010
Device: Kobo aura HD, Kobo Arc, Kindle Fire HDX 8.9 , Kindle for PC
Quote:
Originally Posted by Perkin View Post
@cybmole, that still wouldn't get them all.

What about when it's something like Mr.
Smith, that wouldn't get caught.
thats a tricky one, but I've not actually encountered it in a badly formatted book, YET!

what I do nowadays, because these things irritate me, is keep a pad n pencil handy when I'm reading a poor quality book on Kindle, & make a note of any formats or typos that I want to go back & fix, later. then I use sigil to find n fix in epub, then reconvert to mobi.

the T.V. and L.A. examples were real cases.
cybmole is offline   Reply With Quote
Old 03-10-2011, 08:33 AM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,100
Karma: 4571547
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by cybmole View Post
thats a tricky one, but I've not actually encountered it in a badly formatted book, YET!
I have

Whatever you do, only a careful (proof)reading (or several) of the book will catch some of them.

Quote:
what I do nowadays, because these things irritate me, is keep a pad n pencil handy when I'm reading a poor quality book on Kindle, & make a note of any formats or typos that I want to go back & fix, later. then I use sigil to find n fix in epub, then reconvert to mobi.
Exactly what I do, except that I edit the ePUB by hand and don't convert to mobi.
Jellby is offline   Reply With Quote
Old 03-10-2011, 01:00 PM   #9
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
Posts: 60
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
This is why I like to do most of my reformatting in Word where a VBA macro takes care of all these possibilities. It lets me string together a series of Find-Replace operations and set Styles. In the case of 'Mr.', yes, I've had that occur so added a Find-Replace to correct it:
With Selection.Find
.Text = "Mr.^p"
.Replacement.Text = "Mr."
Faster is offline   Reply With Quote
Old 03-10-2011, 04:37 PM   #10
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
Yes but then there's lots of possibilities

Mr. Mrs. Dr. Prof. Ms. Miss. Messrs. ..... and probably lots more

There's also other names, with initials, P.
Smith wouldn't get found either.
Perkin 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
Regex Question Archon Conversion 11 02-05-2011 10:13 AM
What a regex is Worldwalker Calibre 20 05-10-2010 05:51 AM
Help with a regex A.T.E. Calibre 1 04-05-2010 07:50 AM
Import files, regex question al35 Calibre 0 03-22-2010 12:33 PM
Regex help... Bobthebass Workshop 6 04-26-2009 03:54 PM


All times are GMT -4. The time now is 07:41 AM.


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