@mpheath said in search and extracting text from text file:
Press button Copy Marked Text.
Press Ctrl+N to open a new tab and press Ctrl+V to paste.
The result may have ---- lines separating the captures in the pasted content.
This (the ---- lines) will happen when marked text contains a line-ending(s).
If you search for something simple, e.g. foobar and it occurs many times, when you do Copy Marked Text each match will be separated by a line-ending, typically CRLF, and no ---- will appear.
However, if the search hit contains a line-ending, then a Copy Marked Text, in the copied text the matches are separated by ----CRLF, so that you can see what is actually part of the match and what is delimiter. In other words, the ---- lines are the delimiter.
Example text:
fubar
foobar
foo
bar
fu
bar
Use the Mark function and mark the regex (?-s)f[ou].*?bar and press Copy Marked Text, and then Paste elsewhere to obtain:
fubar
foobar
Use the Mark function and mark the regex (?s)f[ou].*?bar and press Copy Marked Text, and then Paste elsewhere to obtain:
fubar
----
foobar
----
foo
bar
----
fu
bar
I don’t know that this is expressed in the user manual.