01-10-2013, 11:52 PM | #1 |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
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> 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-10-2013 at 11:53 PM. Reason: RegEx to change SOME but not all |
01-11-2013, 07:08 AM | #2 |
Grand Sorcerer
Posts: 5,637
Karma: 23191067
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> |
Advert | |
|
01-11-2013, 09:30 AM | #3 |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
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 |
|
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 06:44 PM |
RegEx Help | ghostyjack | Workshop | 4 | 03-22-2012 09:24 AM |
Regex | Gunnerp245 | Conversion | 5 | 03-05-2012 04:15 PM |
RegEx | el.motar | Sigil | 10 | 12-12-2011 05:54 PM |
Break on POV change also, or only on Scene Change? | Steven Lake | Writers' Corner | 2 | 11-27-2010 08:44 PM |