Built-in way to search/replace in a range

My goal is to improve UX by letting user search and replace matches within a main selection (later in multiple selections).

So far I haven’t found anything in this regards. So my question: is there a built-in way to search/replace within a range?

Since I didn’t find from/to options on SearchQuery, I guess I should use getCursor method, write custom logic for search/replace handling and probably use highlightSelectionMatches to exclude highlighted matches that are out of the range.

Can anyone point me in the right direction?