Multi-file search: Show entire matched string, not just first matched line



  • When searching in multiple files, is it possible to display the entire matched string for each match in the list, not just the first matched line from each file?

    I need this so I can ensure my search criteria is perfect prior to doing a multi-file string replacement.



  • Not sure what you are seeing, but if I do a find in files (or find in all open documents) I see all of the lines that match in all of the files.



  • You’re right for some searches. However, my search matches text on multiple lines with one regex.

    For example, a few files contain:

    First line
    Second line
    Third line

    My regex is:

    First.*line

    That (being a greedy-mode regex) matches everything from"First" to the last instance of “line” – three lines of text matched.

    When I do that, I get what I reported – just the first line of the match (“First line”) showing in my “Find result” list. Not what I want.

    If I do a regex that has multiple single-line matches, those all display.

    I’d show a picture, but I don’t know where to host the pic. I don’t see an upload feature here.

    Any ideas, folks?

    Thanks.



  • Oh, I see. I hadn’t tried a regex whose match spanned multiple lines. I’m guessing whomever wrote the code to display the find results didn’t consider such a case either.

    I don’t imagine there is any way (short of modifying the N++ code) to do what you want.



  • Thanks. Sorry to hear it. I guess I’ll test the regexes with grep instead, then later run them with Notepad++.



  • @Eiren-Smith

    I wouldn’t do that…grep and Notepad++ use different flavors of regex engine. No guarantee that the results are going to be the same.



  • Thanks, Scott. I later noticed that. Oh, well.


Log in to reply