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 08-23-2011, 05:18 PM   #1
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool ^[a-z] returns nothing

i've run into a document that is full of broken paragraphs. in order to repair this problem i've tried to search for new paragraphs that begin with a lower case character, but have had no success as the regex expression ^[a-z] returns nothing.
alansplace is offline   Reply With Quote
Old 08-23-2011, 05:58 PM   #2
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 688
Karma: 150000
Join Date: Feb 2010
Device: none
You're not trying it in book view, are you?

You need to do it in code view, and with a different regex, more like
Code:
>[a-z]
for starters. But search the forums for this topic -- I seem to recall a lot of discussion about what the perfect regex would be.
st_albert is offline   Reply With Quote
Advert
Old 08-23-2011, 06:16 PM   #3
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool thanks

Quote:
Originally Posted by st_albert View Post
You're not trying it in book view, are you?

You need to do it in code view, and with a different regex, more like
Code:
>[a-z]
for starters. But search the forums for this topic -- I seem to recall a lot of discussion about what the perfect regex would be.
yes i was, i never even considered code view! yes, that works just splendidly. i thank you for sharing your insight.
alansplace is offline   Reply With Quote
Old 08-23-2011, 06:25 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: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by alansplace View Post
i've run into a document that is full of broken paragraphs. in order to repair this problem i've tried to search for new paragraphs that begin with a lower case character, but have had no success as the regex expression ^[a-z] returns nothing.
This works for me in epp.

Code:
Find: ([^.”:?'!>—’)])</p>\s+<p>

Replace: \1 space
I search for paragraphs that do not end with a proper terminal followed by crlfs and a new paragraph.

Code:
<p>Now is the time</p>
<p>for all good men to come.</p>
becomes
Code:
<p>Now is the time for all good men to come.</p>
crutledge is offline   Reply With Quote
Old 08-23-2011, 06:37 PM   #5
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool thanks

Quote:
Originally Posted by crutledge View Post
This works for me in epp.

Code:
Find: ([^.”:?'!>—’)])</p>\s+<p>

Replace: \1 space
I search for paragraphs that do not end with a proper terminal followed by crlfs and a new paragraph.

Code:
<p>Now is the time</p>
<p>for all good men to come.</p>
becomes
Code:
<p>Now is the time for all good men to come.</p>
i don't grok 'epp', but that code did not find the broken paragraph in sigil code view. but then the code is more complex than just <p>text</p> and i' a rank beginner at regex and html.

here's a common example:

rusting</p>

<p class="calibre7">away.


Last edited by alansplace; 08-23-2011 at 06:46 PM. Reason: add a line
alansplace is offline   Reply With Quote
Advert
Old 08-23-2011, 07:30 PM   #6
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,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by alansplace View Post
rusting</p>

<p class="calibre7">away.
Code:
([^.”:?'!>—’)])</p>\s+<p[^>]*>
user_none is offline   Reply With Quote
Old 08-23-2011, 08:01 PM   #7
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: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Remember Case Sensitive setting (me recently forgot )
theducks is offline   Reply With Quote
Old 08-23-2011, 09:21 PM   #8
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
thanks

Quote:
Originally Posted by user_none View Post
Code:
([^.”:?'!>—’)])</p>\s+<p[^>]*>
cool,
alansplace is offline   Reply With Quote
Old 08-23-2011, 09:23 PM   #9
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
thanks

Quote:
Originally Posted by theducks View Post
Remember Case Sensitive setting (me recently forgot )
i take it you mean the match case check-box. yeah, that's checked.

i'm slowly learning how to use regex. i started with pablo's pdf intro and haven't found much else except for googling................how do you spell that? specific problems.

Last edited by alansplace; 08-23-2011 at 09:26 PM.
alansplace is offline   Reply With Quote
Old 08-24-2011, 05:56 AM   #10
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Hi Alan,

Any chance you could upload the file in question? I'm new to regex as well and would like to follow along and see what I could lean.

Regards - John
Jabby is offline   Reply With Quote
Old 08-24-2011, 06:20 AM   #11
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: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by user_none View Post
Code:
([^.”:?'!>—’)])</p>\s+<p[^>]*>
Good adjustment.
crutledge is offline   Reply With Quote
Old 08-24-2011, 12:34 PM   #12
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool thanks

Quote:
Originally Posted by user_none View Post
Code:
([^.”:?'!>—’)])</p>\s+<p[^>]*>
Quote:
Originally Posted by alansplace View Post
cool,
well, that file is fixed, it had over 400 broken paragraphs.
again!
alansplace is offline   Reply With Quote
Old 08-24-2011, 12:36 PM   #13
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool gone

Quote:
Originally Posted by Jabby View Post
Hi Alan,

Any chance you could upload the file in question? I'm new to regex as well and would like to follow along and see what I could lean.

Regards - John
sorry, that file no longer exists. i'm sure you can find/create a file to practice on though.
alansplace is offline   Reply With Quote
Old 08-24-2011, 01:10 PM   #14
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,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by alansplace View Post
sorry, that file no longer exists. i'm sure you can find/create a file to practice on though.
Do a PDF input conversation with calibre and set the line unwrapping factor to 1.
user_none is offline   Reply With Quote
Old 08-24-2011, 03:36 PM   #15
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool search & replace

Quote:
Originally Posted by user_none View Post
Do a PDF input conversation with calibre and set the line unwrapping factor to 1.
on my practice file your code string finds non-broken paragraphs. so i'll ask this. is there a document along the lines of pablo's quick and dirty epub tutorial that covers creating regex search & replace stuff?
alansplace 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
library book returns makani General Discussions 7 09-13-2010 08:13 PM
The Prodigal Returns Prince Hal Amazon Kindle 2 03-03-2010 02:45 PM
PRS-500 Returns! squeakywheel Sony Reader 7 02-02-2010 03:27 PM
Forcing carriage returns KindleHog Amazon Kindle 3 05-01-2009 01:14 PM
iRex returns imagitronics iRex 0 01-03-2009 08:56 AM


All times are GMT -4. The time now is 11:14 AM.


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