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-06-2013, 11:10 AM   #211
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by ReaderRabbit View Post
Is there a command to fix this type of error?

<p class="calibre1">“That makes her sound like an ungrateful victim,”</p>

<p class="calibre1">Peggy said.</p>
This modified version of Join Paragraph should work:

Find:
([[:alpha:],”*])</p>\s*<p\b[^>]*>
Replace: \1

Note that there needs to be a space after \1.
Doitsu is offline   Reply With Quote
Old 03-18-2013, 03:08 PM   #212
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 24
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
I scanned through this thread and did not see a solution for this, but I am tryhing to find words in all capitals in my epub. For example: <p class="calibre1">I drove under a sign that said THE MAGNOLIA RANCH.</p> Is there a Regex for finding words with more than one letter in all caps?
ReaderRabbit is offline   Reply With Quote
Old 03-18-2013, 03:34 PM   #213
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by ReaderRabbit View Post
Is there a Regex for finding words with more than one letter in all caps?

[[:upper:]]{2,}
Doitsu is offline   Reply With Quote
Old 03-18-2013, 03:59 PM   #214
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 24
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Quote:
Originally Posted by Doitsu View Post

[[:upper:]]{2,}
I thought this would work too, but it does not work for me
ReaderRabbit is offline   Reply With Quote
Old 03-18-2013, 04:02 PM   #215
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,703
Karma: 54369092
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ReaderRabbit View Post
I thought this would work too, but it does not work for me
aren't the outer brackets supposed to be curved?
theducks is online now   Reply With Quote
Old 03-18-2013, 04:21 PM   #216
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by ReaderRabbit View Post
I thought this would work too, but it does not work for me
It works fine with my Sigil 7.1. version. Are you sure that you've selected the regex mode?
If all else fails, you could simply buy the book.

Quote:
Originally Posted by theducks View Post
aren't the outer brackets supposed to be curved?
No, [[:upper:]] is a POSIX character class and the two curly brackets after it specify 2 or more occurrences.
Of course, you'll also need to add two additional curved brackets around the Regex to define the backreference.
Doitsu is offline   Reply With Quote
Old 03-18-2013, 04:26 PM   #217
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by Doitsu View Post

[[:upper:]]{2,}
Another possibility:

Code:
[A-Z][A-Z]+
Pablo is offline   Reply With Quote
Old 03-19-2013, 10:41 AM   #218
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 24
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Thank You

Quote:
Originally Posted by Pablo View Post
Another possibility:

Code:
[A-Z][A-Z]+
I ended up using a combination of both suggestions: [A-Z]{2,}

Thanks so much.


Last edited by ReaderRabbit; 03-20-2013 at 07:38 PM.
ReaderRabbit is offline   Reply With Quote
Old 06-02-2013, 05:48 PM   #219
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 24
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Is there a Regex that would find a sentence ending with a period but no space after it?

EX: But he seemed glad to sit there.People don’t want to know.

I am reading a book that has a lot of these errors in it. VERY annoying . . . would like to fix this.

Thanks to all.
ReaderRabbit is offline   Reply With Quote
Old 06-02-2013, 05:54 PM   #220
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,675
Karma: 128176798
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by ReaderRabbit View Post
Is there a Regex that would find a sentence ending with a period but no space after it?

EX: But he seemed glad to sit there.People don’t want to know.

I am reading a book that has a lot of these errors in it. VERY annoying . . . would like to fix this.

Thanks to all.
Find:
Code:
\.([A-Z])
Replace:
Code:
\. \1
That will find all cases of . followed by an uppercase letter and add in a space. But, that will also find things like P.M. and convert it to P. M..

Last edited by JSWolf; 06-02-2013 at 05:56 PM.
JSWolf is offline   Reply With Quote
Old 06-02-2013, 06:06 PM   #221
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,124
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Why not try
Code:
([a-z])\.([A-Z])
replace by
Code:
\1\. \2
This will find a lower-case letter, followed by a period and an upper-case letter, and replace them by the lower-case letter, period, a space and the upper-case letter.
PeterT is offline   Reply With Quote
Old 06-02-2013, 06:29 PM   #222
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 24
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Thanks

Quote:
Originally Posted by PeterT View Post
Why not try
Code:
([a-z])\.([A-Z])
replace by
Code:
\1\. \2
This will find a lower-case letter, followed by a period and an upper-case letter, and replace them by the lower-case letter, period, a space and the upper-case letter.
That worked but what if the sentence ends with a '?' or '!'

Thanks so much.
ReaderRabbit is offline   Reply With Quote
Old 06-02-2013, 06:37 PM   #223
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,124
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Try
Code:
([a-z])([\.\?\!])([A-Z])
and
\1\2 \3
* I MIGHT have escaped more than I need too... Probably [.?!] would work instead of [\.\?\!]

Last edited by PeterT; 06-02-2013 at 06:41 PM.
PeterT is offline   Reply With Quote
Old 06-02-2013, 06:41 PM   #224
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by ReaderRabbit View Post
That worked but what if the sentence ends with a '?' or '!'
the ? you need to escape with a slash, but the ! you can just drop in there.

this would work:

Code:
([a-z])([\.\?!])([A-Z])

\1\2 \3
the [] is basically looking for any one of the characters inside of it.


this is a really great reference:

http://www.regular-expressions.info/characters.html

Last edited by mzmm; 06-02-2013 at 07:01 PM. Reason: removed inaccurate information
mzmm is offline   Reply With Quote
Old 06-02-2013, 06:42 PM   #225
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by PeterT View Post
Try
Code:
([a-z])([\.\?\!])([A-Z])
and
\1\2 \3
* I MIGHT have escaped more than I need too... Probably [.?!] would work instead of [\.\?\!]
yep, beat me to it but the ! doesn't need escaping

** edit, turns out the ? doesn't need escaping either.
mzmm 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
Examples of Subgroups emonti8384 Lounge 32 02-26-2011 06:00 PM
Accessories Pen examples Gunnerp245 enTourage Archive 15 02-21-2011 03:23 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 08:24 PM
Examples kafkaesque1978 iRiver Story 1 07-26-2010 03:49 PM
Looking for examples of typos in eBooks Tonycole General Discussions 1 05-05-2010 04:23 AM


All times are GMT -4. The time now is 03:05 AM.


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