|
|
#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 |
|
|
|
|
|
#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 | |
|
|
|
|
#3 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,288
Karma: 62000000
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 10:44 AM. Reason: revised |
|
|
|
|
|
|
#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 10:08 PM |
| Regex Question | Archon | Conversion | 11 | 02-05-2011 11:13 AM |
| What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 06:51 AM |
| Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 08:50 AM |
| Regex help... | Bobthebass | Workshop | 6 | 04-26-2009 04:54 PM |