Set Arabic and Hebrew Paragraphs to Right-to-Left in Writer
Enable Writer’s bidirectional controls, set RTL paragraph flow, and check mixed Arabic or Hebrew text without disrupting English words and numbers.
For advanced editing in LibreOffice Writer, open Edit > Find & Replace, expand More Options, and enable Regular expressions. Enter a pattern in Find and, if you want to change the matched text, a replacement in Replace. Use Find All or Find Next to inspect matches before choosing Replace All.
The current LibreOffice 26.8 Help describes this workflow. Regex can clean repeated spaces, locate structured text such as dates, or rearrange parts of names in one pass. The patterns below are for Writer’s Find and Replace dialog; do not assume another program uses identical syntax.
Save a copy of an important document before making a large edit. This gives you a clean fallback if a pattern matches more than expected. In Writer, choose Edit > Find & Replace or press Ctrl+H on Windows and Linux, or Command+H on macOS.
LibreOffice treats a period (.) as any single character and an asterisk (*) as zero or more repetitions of the previous expression. Therefore, .* means zero or more characters within a paragraph. A plain asterisk is not the same as the common file-search wildcard meaning “any text.” Writer’s regular expression search is documented separately from wildcard search.

Start with the smallest specific pattern that describes your target. Use anchors when the whole paragraph must match: ^ means the start of a paragraph and $ means its end. For example, ^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}$ finds a paragraph containing only a date in YYYY-MM-DD shape. It checks the shape, not whether the date is a real calendar date.
Common building blocks include \d for a decimal digit, \w for a word character, + for one or more repetitions, and square-bracket ranges such as [A-Z]. LibreOffice also documents character classes such as [[:alpha:]] and [[:digit:]]. Prefer the character class when text may include letters beyond basic English A–Z.
To clean repeated spaces, search for [ ]{2,} and replace it with one ordinary space. This pattern targets two or more literal spaces; it does not target tabs. Click Find All first to confirm that the highlighted areas are the spacing errors you mean to fix.
Parentheses capture parts of a match so the replacement can reuse them. For a document containing names such as “Smith, Ana,” use this Find pattern:
([A-Za-z]+), ([A-Za-z]+)
Enter this in Replace:
$2 $1
The first group is the surname and the second is the given name, so “Smith, Ana” becomes “Ana Smith.” In LibreOffice, capture groups are written as , , and so on in the Find expression, then referenced as $1, $2, and so on in Replace. This example’s [A-Za-z] ranges cover basic English letters only; for names with accented letters, use the documented [[:alpha:]] class in both groups and inspect the results.

| Task | Find | Replace |
|---|---|---|
| Collapse repeated spaces | [ ]{2,} | One space |
| Reorder “Surname, Given” | ([[:alpha:]]+), ([[:alpha:]]+) | $2 $1 |
| Reformat YYYY-MM-DD text | ([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2}) | $2/$3/$1 |
| Find an empty paragraph | ^$ | Review before replacing |
The date pattern changes the visual order to MM/DD/YYYY; use it only if that format suits your readers. It does not validate dates or understand locale conventions. For empty paragraphs, use Find Next first. Deleting paragraph marks can change spacing and document structure, so do not run a broad replacement without reviewing the result.
![The Find & Replace dialog shows the pattern ([A-Za-z]+), ([A-Za-z]+) and replacement $2 $1, with Smith, Ana selected in the document.](https://www.webtech360.com/resources_cts/images2/use-regex-in-libreoffice-writer-to-edit-text-in_213309981.webp)
Use Find Next to step through a few matches when a pattern is new. Use Find All to see the complete set of selected matches before replacement. If it highlights part of a word, catches unexpected punctuation, or skips accented letters, narrow or revise the pattern rather than accepting the results.
When the selection is correct, click Replace to change one match at a time or Replace All for the full document. Check the result immediately. If it is wrong, use Ctrl+Z (or the Undo command on your system) before making other edits, then adjust the pattern.
One important limit: Writer’s regex searches operate within a paragraph. The dot does not cross paragraph breaks. In the Find box, \n matches a manual line break inserted with Shift+Enter; in Writer’s Replace box, \n inserts a paragraph break. Treat that replacement carefully because it can split text into new paragraphs.

For the full syntax and edge cases, consult LibreOffice’s Writer guide to regular-expression searches, its regular-expression reference, and the Find and Replace dialog help.
Enable Writer’s bidirectional controls, set RTL paragraph flow, and check mixed Arabic or Hebrew text without disrupting English words and numbers.
Install metric-compatible Linux fonts or map LibreOffice fallbacks, while keeping Microsoft font licensing and layout differences in view.
Add usable text fields, check boxes, and drop-downs in Writer, then export a PDF recipients can complete and save.
Fix missing or substituted fonts in LibreOffice Writer PDFs, choose the right export profile, and verify which fonts are embedded before sharing.
Convert a folder of Word documents to PDF with LibreOffice commands, handle nested folders safely, and verify the output before sharing.
Set a custom LibreOffice Writer template as the default so new documents open with your preferred styles and page layout.
Install a compatible Java runtime, enable it in LibreOffice, and troubleshoot an empty JRE list without changing unrelated settings.
Build a small LibreOffice container, convert office documents without a GUI, and verify PDF output while limiting host-file access.
Reduce oversized LibreOffice presentation files by compressing embedded photos, choosing sensible image settings, and checking slide quality before sharing.
Match LibreOffice’s page dimensions to your printer, check printable margins, and correct scaling before printing a custom-size document.