05-09-2011, 02:34 AM | #1 |
Zealot
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
|
Regex Problem
Hi,
how can i change Code:
<div> sentence1<br /> sentence2<br /> sentence3<br /> sentence4<br /> </div> Code:
<p>sentence1</p> <p>sentence2</p> <p>sentence3</p> <p>sentence4</p> thx in advance |
05-09-2011, 07:06 AM | #2 | ||||||
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Search for
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
||||||
Advert | |
|
05-09-2011, 09:42 AM | #3 | |
Well trained by Cats
Posts: 30,419
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
<div>(.+)<br />\s+</div> <p>\1</p> now replace the: <br /> with </p> <p> Tidy will clean the code view after switching to BV choosing the best order, leaves the least touch-up Last edited by theducks; 05-09-2011 at 09:44 AM. Reason: revised |
|
05-10-2011, 04:32 AM | #4 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
i can confirm that will work - I've patched up books which were all <div> & no <p> using the above approach.
i didn't bother to find/replace the trailing </div> tags as tidy took care of that for me. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex | Faster | Sigil | 2 | 04-24-2011 09:08 PM |
Regex Question | Archon | Conversion | 11 | 02-05-2011 10:13 AM |
What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 05:51 AM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |
Regex help... | Bobthebass | Workshop | 6 | 04-26-2009 03:54 PM |