|
|
#1 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,365
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Search and replace a paragraph on next line
I downloaded a fanfic that looks like this:
Code:
<p>Blah blah blah</br> Blah blah blah</br> Blah blah blah</br> Blah blah blah</p> Code:
<p>Blah blah blah</p> <p>Blah blah blah</p> <p>Blah blah blah</p> <p>Blah blah blah</p> |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,689
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Try...
Code:
</br>\n?\s+ ?\s+ is there in case you have indented the lines. ==Edit== Sorry, gave you the wrong solution. The repace is Code:
</p>\n<p> Last edited by Karellen; 01-04-2025 at 06:14 PM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,365
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thanks
|
|
|
|
|
|
#4 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Thanks, helped me too.
|
|
|
|
|
|
#5 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,365
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
New question: I have another fanfic that looks like this:
Code:
<p>Blah blah blah. <br/> Blah blah blah.<br/> <br/> Blah blah blah.<br/> <br/> Blah blah blah.</p> |
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,689
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Assuming you want separate paragraphs
Search... (\n)?(<br/>)?\n<br/>\n Replace... </p>\n<p> A little bit more complicated because the first line has only a single <br/> |
|
|
|
|
|
#7 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,365
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thank you
|
|
|
|
|
|
#8 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
Or this one, which works with any number of <br/> (separated or not by a new line) :
Code:
\n?(<br/>\n?)+ |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to replace text with Search and Replace with regex on Calibre | darrnih | ePub | 2 | 04-02-2024 03:10 AM |
| Regex in search problems (NOT Search&Replace; the search bar) | lairdb | Calibre | 3 | 03-15-2017 08:10 PM |
| save multiple search/replace, or search/replace multiple ebooks | user743 | Editor | 12 | 04-12-2014 03:38 AM |
| Command Line Search and Replace Metadata | metalhammer | Calibre | 1 | 05-02-2012 06:13 AM |
| search and replace - drops blanks in replace ? | cybmole | Conversion | 10 | 03-13-2011 04:07 AM |