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-30-2014, 02:30 PM   #406
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Quote:
Originally Posted by Steadyhands View Post
You need to be in Regex mode in the search box for this to work.
I am in Mode: Regex and 'All HTML Files'
ReaderRabbit is offline   Reply With Quote
Old 08-31-2014, 12:56 AM   #407
eschwartz
Irrational Optimist
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.
 
Posts: 5,774
Karma: 9053478
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch (Wifi only)
Quote:
Originally Posted by Steadyhands View Post
Note you will have to change the xxxx to whatever your paragraph style and there is a space after the \1
No, change the xxxx\d+ . (This may be why ReaderRabbit was no successful, as it certainly would lead to failure if the class does not have trailing numbers. Like in the example given: "indent".)

It woud be better to use a catchall like

Find:
Code:
((Mr|Mrs|Dr|other)\.)</p>\s*<p( [^>]*)?>
Replace:
Code:
\1
(space after the 1)

Last edited by eschwartz; 08-31-2014 at 01:01 AM.
eschwartz is online now   Reply With Quote
Old 08-31-2014, 06:48 AM   #408
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,006
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by eschwartz View Post
It woud be better to use a catchall like

Find:
Code:
((Mr|Mrs|Dr|other)\.)</p>\s*<p( [^>]*)?>
Replace:
Code:
\1
(space after the 1)
Which would exclude paragraphs that had no attributes. Why not:
Code:
((Mr|Mrs|Dr|other)\.)</p>\s*<p[^>]*?>
Replace:
Code:
\1
(space after the 1)
instead?
DiapDealer is online now   Reply With Quote
Old 08-31-2014, 10:51 AM   #409
eschwartz
Irrational Optimist
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.
 
Posts: 5,774
Karma: 9053478
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch (Wifi only)
Quote:
Originally Posted by DiapDealer View Post
Which would exclude paragraphs that had no attributes. Why not:
Code:
((Mr|Mrs|Dr|other)\.)</p>\s*<p[^>]*?>
Replace:
Code:
\1
(space after the 1)
instead?
Reread my regex. I did think of that.

Nitpick: I used an optional capture group, which includes a space (because as a general idea, I like demanding spaces after the tag name and before the attribute, to avoid matching the wrong tags) -- but your regex does not need a ? because the star already covers that.

Last edited by eschwartz; 08-31-2014 at 10:57 AM.
eschwartz is online now   Reply With Quote
Old 08-31-2014, 11:23 AM   #410
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Smile YEA! That worked :o}

Quote:
Originally Posted by eschwartz View Post
Reread my regex. I did think of that.

Nitpick: I used an optional capture group, which includes a space (because as a general idea, I like demanding spaces after the tag name and before the attribute, to avoid matching the wrong tags) -- but your regex does not need a ? because the star already covers that.
Thank you all for looking into this error for me.
ReaderRabbit is offline   Reply With Quote
Old 08-31-2014, 11:25 AM   #411
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,006
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by eschwartz View Post
Reread my regex. I did think of that.
My bad. I didn't notice the space was inside the optional grouping. Part of the reason I don't like to use a lot of extraneous grouping in my regex.

Quote:
Originally Posted by eschwartz View Post
Nitpick: I used an optional capture group, which includes a space (because as a general idea, I like demanding spaces after the tag name and before the attribute, to avoid matching the wrong tags)
If you're worried about matching the wrong tags (like <image for <i), just make sure there's a word break after the element name.
Code:
<p\b[^>]*>
Or if you're in calibre's editor, even the end-of-word match:
Code:
<p\M[^>]*>
DiapDealer is online now   Reply With Quote
Old 08-31-2014, 12:55 PM   #412
eschwartz
Irrational Optimist
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.
 
Posts: 5,774
Karma: 9053478
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch (Wifi only)
Quote:
Originally Posted by DiapDealer View Post
My bad. I didn't notice the space was inside the optional grouping. Part of the reason I don't like to use a lot of extraneous grouping in my regex.


If you're worried about matching the wrong tags (like <image for <i), just make sure there's a word break after the element name.
Code:
<p\b[^>]*>
Or if you're in calibre's editor, even the end-of-word match:
Code:
<p\M[^>]*>
That works too.

Po-tay-to po-tah-to.

Doesn't confuse me, I got used to doing it this way (seems in my subjective opinion to make more sense), etc. Never really fell in love with word boundaries.
eschwartz is online now   Reply With Quote
Old 08-31-2014, 02:03 PM   #413
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,006
Karma: 40853212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by eschwartz View Post
Po-tay-to po-tah-to.

Doesn't confuse me, I got used to doing it this way (seems in my subjective opinion to make more sense), etc. Never really fell in love with word boundaries.
Oh, absolutely. Lots of ways to skin the same cat. I don't love any of it, to tell the truth. I just find word boundaries to useful NOT to use. *shrug*
DiapDealer is online now   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 04:05 PM.


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