Please see the attached screenshots. “1.png” (the top image) is the text I’m starting with, “2.png” (the bottom image) is how I would like it to look after using regular expressions by means of find and replace (if possible). Normally, I would do this by placing the cursor at the beginning of an unindented paragraph and hit the tab key, but it would be nice not to have to do this for a very long document!
With Regular expressions turned on, try find
^(.)
and replace it with
\t$1
The caret (^) finds the first character of a paragraph. If the first character (.) is put into brackets, the dollar sign will repeat in the replace pattern whatever the first character is. The tab character itself can be inserted with \t.
https://help.libreoffice.org/latest/en-US/text/shared/01/02100001.html
Is this to be applied to every paragraph in the document? If so, you should use a style.
for the sake of regex, that would be ^([^\t])
but of course, that’s definitely NOT the way to go. XY problem - Wikipedia
“Aligning” paragraphs or words with space or tab characters is wrong. First, it is a pernicious form of direct formatting which sooner or later plays nasty tricks on our back when you try to tune your formatting (as is indirectly demonstrated here). Second, you depend on various implicit settings like the default distance of evenly-spaced tab stops, meaning you don’t control accurately the position.
All your paragraphs are formatted by a paragraph style, which is Body Text if you already have a moderate practice of styles.
A paragraph style defines its “geometry” (left and right indents, aka. additional margins, spacing above an below, alignment, …) and text properties (font face, size, …). Among the geometry parameters, the one you’re interested in is first line indent. Set it to any distance of your liking. All paragraphs will instantly be updated.
If your skills don’t exceed the mechanical typewriter workflow, your text is likely to be styled Default Paragraph Style. Despite all the problems induced by use of this style, you can also modify it to set first line indent. But this workflow tends to encourage direct formatting (DF) and DF always takes precedence on styles. So, if modifying the style(s) does not result in the intended formatting everywhere, you have DF where it does not change.
You can also apply DF to your existing text (but I don’t endorse this practice because it degrades the structural quality of the document):
- select all text or Ctl+A
- in the horizontal ruler, you have two triangular cursors at left; drag the upper down-pointing cursor to the position of your indent
PS: when asking here, always mention OS name, exact LO version and save format. The latter is the most important because most tips are valid only for .odt.