|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,090
Karma: 447222
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-11-2013 at 12:53 AM. Reason: RegEx to change SOME but not all |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763
Karma: 24088559
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 | |
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,090
Karma: 447222
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 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 |