In LibreOffice Writer v7.4.0.3 I would like to find:
some text
and replace it with (append two == and suffix two ==).
==some text==
I tried the following:
- New Writer document.
- In document write: some text
- Select text and select from menu Format | Character
- In Font tab in Western sub-tab select Font= Arial and click on OK** button.
- Menu Edit | Find and Replace
- Click on Find data field and type in:
(.*)
- Click on Format button.
- Select the same as in step 4.
- Click on Replace** data field and type in:
==$1==
- Check the Regular expressions check box and click on Replace All button.
Result: Text “some text” gets correctly replaced with “==some text==”.
Now I would like to do the same with “Heading 2” style.
- New Writer document.
- In document write: some text
- Select text and right click and select Paragraph | Heading 2 (or select Heading 2 style from toolbar).
- Right click on text and select Paragraph | Edit Style.
- Repeat steps from 4 to 10 from previous section instructions above.
Result: text does not get replaced. In dialog is also displayed “Search key not found”.
How to find/replace text when text is using styles instead of direct editing.
P.S. I closed down LibreOffice and open it, so all of the find/replace settings are lost from about steps and in Find and Replace dialog I have tried to check Paragraph Styles, but in this case Regular expressions are greyed out and it looks like you can only replace one paragraph style with another paragraph style, so not really useful for find/replace in my case.