Hello, @cacarasa-parada, @@peterjones, @scott-sumner and All,
Arrrrgh, sorry, I’m really confused ! I confess that, when elaborating my previous post, I just verified that my regexes were correct, but, without even doing a mark test :-(( I would, certainly, have noticed that well-known fact !
However, the search regexes, of my previous post, are still reliable when a great amount of text must be simply replaced by the contents of the Replace area :-))
On the other hand, if your regex identifies some specific lines in the scanned file(s), the Search > Bookmark > Paste to (Replace) Bookmarked Lines command allow you to replace each of those specific lines with the clipboard contents, which may have a consequent size !
Now, even if the Mark feature would have marked all the lines, matched in a Multi-lines search, the Search > Bookmark > Paste to (Replace) Bookmarked Lines command would have been useless, as every line marked would have been replaced with the clipboard contents ! Not the expected result, isn’t it !!
But I’ve got an easy solution !! Don’t you see ?..
Well, regarding the different areas of text, whatever their reasonable size, which will be replaced, each, by the clipboard contents :
Insert a line, with a Start Mark, before these areas of text
Insert a line, with a Stop Mark after these areas of text
Now, perform the following global replacement :
SEARCH (?s)^\QStart Mark\E.+?(?=^\QStop Mark\E)
REPLACE Leave EMPTY
=> After replacement, the area(s) of text is/are deleted and it just remains one/several line(s) Stop Mark, which will be replaced by the clipboard contents. Now, everything is clear :
First, put the replaced text, whatever its size, in the clipboard
Open the Mark panel
Enter the simple search regex \QStop Mark\E
Tick the Bookmark line option and, may be, the Purge for each search option
Click on the Mark button
Select the Search > Bookmark > Paste to (Replace) Bookmarked Lines command
=> Every line Strop Mark will be replaced with the clipboard contents ;-))
You are done !
If your marks do not contain any special regex character, you can omit the \Q and \E escape sequences
Your marks can, also, be any simple character, assuming that your text does not contain this character at column 1. For instance, if your Start Mark and Stop Mark are, respectively, the # and the @ symbols, just use the regex S/R :
REPLACE Leave EMPTY