Date: prev next · Thread: first prev next last
2021 Archives by date, by thread · List index


At 14:19 03/01/2021 -0500, William Noname wrote:
I have a script that mysteriously became double spaced. I want to search for 2 end of paragraph marks and replace them with one.

So it's the paragraphs that are spaced, not lines (the usual meaning of "double-spaced")?

I can do a regex search for $ and find them all, but $$ finds none - I presume there is something between them that does not show as a formatting mark.

You are labouring under the common misapprehension that the pilcrow that indicates the presence of a paragraph break has an actual presence in the document; no: think of it merely as the indicator that it is. And you think that the $ symbol matches this; also no.

I don't want to remove all blank lines, just the ones that have a blank line following.

In other words you want to remove blank empty *paragraphs*.

What is the regex for a paragraph mark in replace?

There isn't one. Instead, the $ symbol merely locks your pattern, whatever it is, so that it will match only something that occurs at the end of a paragraph.

Or, any other suggestions.

Don't think of searching for paragraph breaks, which you cannot do. Instead, search for the empty paragraphs that you wish to delete. They contain nothing, so the pattern you need is also nothing. But you need to arrange that it matches nothing only if that nothing occurs at the beginning of a paragraph and at the same time at the end of a paragraph. The symbol for locking to the start of a paragraph is the caret, "^", so the pattern you should search for is "^$" (no quotes, of course) - replacing with nothing.

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.