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 01-11-2013, 12:52 AM   #1
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 355
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
RegEx to change but not all

Converted a MOBI to EPUB in Calibre and there's a gizillion of these that generate a validation error ('no character data is allowed by content model')

Code:
<blockquote>
text text text  text text text 
</blockquote>
but also some that have that<p> tags

Code:
<blockquote>
<p>
text text text
</p>
</blockquote>

The regex's I've tried so far have been spectacularly unsuccessful

Could some regex guru help with the S/R to fix the first, but not mess up the second?

Paul

Last edited by phossler; 01-11-2013 at 12:53 AM. Reason: RegEx to change SOME but not all
phossler is online now   Reply With Quote
Old 01-11-2013, 08:08 AM   #2
Doitsu
Wizard
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: 2,049
Karma: 4836606
Join Date: Dec 2010
Device: Kindle PW2
The following quick & dirty regex should work:

Find: <blockquote>\s+([^<]+)\s+</blockquote>
Replace: <blockquote>\n<p>\1</p>\n</blockquote>
Doitsu is offline   Reply With Quote
Old 01-11-2013, 10:30 AM   #3
phossler
Addict
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 355
Karma: 51406
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
Thanks --

I'm tracing my way through it to make sure I understand (and learn)

I usually have the most difficulty with multiple lines and whitespace

Paul
phossler 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
Is it possible to change Calibre-Server.exe to change to a service for Windows roadrunnerm Calibre 1 10-19-2012 07:44 PM
RegEx Help ghostyjack Workshop 4 03-22-2012 10:24 AM
Regex Gunnerp245 Conversion 5 03-05-2012 05:15 PM
RegEx el.motar Sigil 10 12-12-2011 06:54 PM
Break on POV change also, or only on Scene Change? Steven Lake Writers' Corner 2 11-27-2010 09:44 PM


All times are GMT -4. The time now is 02:29 PM.


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