Built-in Edit
>Find & Replace
operates at most on a paragraph. Paragraph breaks are considered delimiters and are outside of the operating range. ^
is the paragraph mark preceding but not included the target pattern and $
is the one following but not included the target pattern.
Consequently, as you guessed $^
does not make sense because it means “the position at end of the paragraph followed by the position before the same paragraph”.
^$
is a special pattern to find empty paragraphs. This pattern can be replaced by “nothing”, effectively deleting the paragraph mark.
In case your line wrap is caused by a line break (Shift
+Enter
) instead of a regular paragraph break (Enter
), it does not create a paragraph break (as the name implies), the line break can be replaced with a regular expression like:
' "\n\s{0,20}\+\s"' ==> ' '
(quotes added to make the spaces visible).
Otherwise, you have two possibilities:
-
You didn’t describe the characteristics of the sequences you want to transform. They look like some programming snippets, meaning they were copied from some source file (in format .txt or the like). It is then easier to process these files before extracting the bits and pasting them into Writer. You can do that easily with sed
, awk
, perl
, grep
or even bash
or combination of them.
-
Install AltSearch extension which is not limited to a single paragraph and may cross paragraph boundaries.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!