@neil-schipper said in Get normal text and find all:
It should be understood why a file would look so different in the two programs. Perhaps Fred could provide screenshots (see FAQ)
Unless Fred comes back, we might never know. My experiments show that the situation will not arise: looking at a valid RTF in a word processor like Word Pad, you will see a pretty, word-processed document; but if you look at it in a text editor, whether it is MS Notepad or our Notepad++, it will show the underlying code, as seen below:
a8707f36-7e26-4292-9fc0-e8d3d05eca51-image.png
So I cannot replicate the initial situation that Fred described. My first guess is that Fred was mistaken, and was actually looking at the RTF in WordPad or some other word processor, not in notepad.exe like was originally stated. But if there is proof to the contrary, I would be curious to see enough evidence to be able to replicate what I believe is an impossible situation.
That said, Neil’s regular expression (regex) solution is the right way of doing the search in Notepad++. But it won’t “copy the results.” If Fred needs the “copy” as well, then use the Mark dialog with the same regular expression; once xyz or abc are marked, then use Search > Copy Styled Text > Find Mark Style (or Find Style (Marked) in slightly older versions of Notepad++) will place all the text that was highlighted in the Mark action into the clipboard. But that seems a bit silly, because it will just end up with N copies of xyz or abc in the clipboard, without any of the surrounding text… If Fred actually wanted to copy any lines that contain either xyz or abc, then the regex would have to be modified to select the whole line: (?-s)^.*(abc|xyz).*$. So, as you said, unless Fred does a much better job of describing what is actually wanted, Fred will likely be disappointed with the results of our guessed solutions.
----
Some bonus info for @fred339:
Useful References
Please Read Before Posting
Template for Search/Replace Questions
FAQ: Where to find regular expressions (regex) documentation
Notepad++ Online User Manual: Searching/Regex