[Solved] Regular expression for paragraph start
-
- Posts: 8
- Joined: Sun Apr 11, 2021 1:30 am
[Solved] Regular expression for paragraph start
I need to add a specific notation to the beginning of every new paragraph(the exact same one for every paragraph). Is there a regular expression or I can search for representing a new paragraph, that I can then insert my notation to be added? Thanks!
Last edited by MrProgrammer on Fri Mar 08, 2024 4:00 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 4.1.6 / WIN10
Re: Regular expression for start of new paragraph?
From the HELP for regular expressions:
As you want to add something to the beginning of existing paragraphs your Find string would be and your Replace string would be
Obviously, replace a specific notation with the actual text required
Note; this will also find text in footers and headers!^
Only finds the search term if the term is at the beginning of a paragraph. Special objects such as empty fields or character-anchored frames, at the beginning of a paragraph are ignored. Example: "^Peter".
As you want to add something to the beginning of existing paragraphs your Find string would be
Code: Select all
(^.)
Code: Select all
a specific notation $1
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.8.3.2; SlackBuild for 24.8.3 by Eric Hameleers
---------------------
Apache OpenOffice 4.1.15
LibreOffice 24.8.3.2; SlackBuild for 24.8.3 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue
Unexpected '{' on line 32
.Re: Regular expression for start of new paragraph?
If you mean an empty paragraph, find with,
A different method than already suggested for a non-empty paragraph is
For the replace for an empty paragraph, whatever you want followed by \n^$
Whatever\n
A different method than already suggested for a non-empty paragraph is
For the replace, add whatever to the front by following with & (& keeps the original text).*
whatever&
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)