![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
match an empty line with a regex?
How can I match an empty line with a regex? I tried both ^$ and ^\s*$ but it says No matches found for both of those. I have a bunch of plain text and I'd like to put a /p and then a p between the paragraphs where there are currently blank lines.
|
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I always look (capture with the mouse) for the closing tag of the previous Paragraph, and newlines then Capture (.+?)to the Newline stuff between that and the <p class+...
|
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
|
![]() |
![]() |
![]() |
#4 |
Belgian Pommes Frites
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 122
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
|
TheDucks:
I have often had this question myself. Unfortunately I do not understand your explanation: When you write "Capture with the Mouse", do you mean, simply select the area, i.e. the empty line, in question? And "Capture (.+?)" throws me completely. I have no idea what that might mean or what I need to do. In Stack Overflow I found a definition for Capture.Mouse but I still do not understand it. Further explanation would be much appreciated. Thanks. |
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
Last edited by lumpynose; 05-29-2019 at 04:34 PM. |
|
![]() |
![]() |
![]() |
#6 |
Belgian Pommes Frites
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 122
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
|
Thanks. Your explanation clarified it completely. Now I know what to do and how.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
REGEX match everything before # | JLius | ePub | 2 | 01-08-2017 04:25 PM |
[Regex Search] Minimal match not possible? | nqk | Editor | 7 | 12-24-2014 03:19 AM |
Replace field with match or empty string? | charlweed | Library Management | 2 | 03-29-2012 12:44 AM |
how to have regex dot match any character including newline? | gnychis | Calibre | 5 | 11-30-2010 06:35 PM |
Need help with a conversion regex - can't match newline | ereader123 | Calibre | 2 | 03-29-2010 10:58 AM |