Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 12; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Hi:
I have a document that is 20 pages long. On page 2 exists the word “dog”. Somewhere in the document exists the word “cat”. How can I highlight the region from “dog” to “cat” without having to scroll up and down and possibly bypass the word “cat” and then have to back up, etc.? It would be neat to type the word “cat” in the Find block and click Find and it would highlight the region from dog to cat.
Built-in Edit
>Find & Replace
has its scope limited to one paragraph only. If your start pattern “dog” and your end pattern “cat” are in different paragraphs, you can’t use built-in search feature. You must install AltSearch extension which lifts this limitation.
Thanks for the quick response. Can you provide me the path to the AltSearch extension you mention? I am aware of the “Find and Replace” function but it doesn’t do any highlighting. I am trying to get away from scrolling. That takes a long time…bypassing the word “cat”, even if you know where it is, is frustrating when you have to back up and pass it up again, etc.
It does: press the Find Next button to select the target, then you can apply any formatting you want, such as a character style.
Your regular expression is: dog.*(?=cat)
Since regular expressions are greedy by default, use the following to match the “cat” closest to “dog”: dog.*?(?=cat)
“Find and Replace” does not have a button “Find” . It has “Find all” and a couple of other Find type of buttons. You also mention “Paragraph Styles” and “Regular expressions”. It won’t let me check both boxes. So which one do I check the box? I am confused. This is a long Document with many paragraphs. Can you give me a step by step procedure?
Use only Regular expressions in F&R dialog. After pressing Find Next, switch to your text (but don’t click because it would clear the selection). You may keep F&R if you want to find the next occurrence later. Apply a character style on your selection, some formatting with toolbar buttons, or type something to replace it.
This method doesn’t work. I may be skipping a step. I don’t know. Unless you go
Step: 1 click on “Find and Replace”.
Step 2: type dog in the “Find” block.
Step 3: ,etc.
A dialog box opens but “AltSearch” doesn’t appear in the listing. Thus I am unable to fill in the “File name” block.
Have you ticked the Regular expressions box? Have you typed exactly the regular expression in Find:?
Reminder: built-in F&R will work only when both “dog” and “cat” are in the same paragraph.
I don’t use AltSearch (because I have not yet felt the need for it).

How can I highlight the region from “dog” to “cat”
Using Alternative Search and Replace, tick Regular Expressions and in Find, enter dog[::BigBlock::]cat
That will search and highlight across paragraphs
I did Tools>Extensions>AltSearch>Add. Dialog box opened. What do I type in the “File name” block?

Tools>Extensions>AltSearch
so, it is installed;
no need to Add again.
now check your Edit menu :
→

dog[::BigBlock::]cat
Wonderful. Works great. You are so smart. Is there a listing of codes similar to “dog[::BigBlock::]cat” that can typed into the “Find” block to perform various tasks using this AltSearch extension?
Look through the drop down boxes above the Find field. Big Block is the first entry in Extended but it is listed by its description, something to do with searching across paragraphs from one marker to another.
There is also the homepage and Help listed on the Extensions page, AltSearch » Libreoffice Extensions
Thanks, a bit difficult for my level but you seem to be up there. Good luck to you.
Appreciate it, fpy.