• Login
Community
  • Login

[Wishlist] Reverse search

Scheduled Pinned Locked Moved General Discussion
6 Posts 5 Posters 618 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    Dario de Judicibus 0
    last edited by Dario de Judicibus 0 Jun 2, 2023, 3:56 PM Jun 2, 2023, 3:56 PM

    It might be useful to have an option when you search in files to select all the files where the search fails. It should work for both normal search and regular expressions. For example, select all files where there is not word “Abracadabra” in folder c:\wizard.

    A 1 Reply Last reply Jun 2, 2023, 5:26 PM Reply Quote 0
    • A
      Alan Kilborn @Dario de Judicibus 0
      last edited by Alan Kilborn Jun 2, 2023, 5:27 PM Jun 2, 2023, 5:26 PM

      @Dario-de-Judicibus-0

      Do a regular expression search for (?s-i)\A(?:(?!\QYour Expression\E).)+\z
      where, in your example, Your Expression = Abracadabra

      Reference: https://community.notepad-plus-plus.org/topic/19134 Mar 31, 2020, 9:57 AM posting

      1 Reply Last reply Reply Quote 4
      • M
        Michael Pisco
        last edited by Jun 2, 2023, 8:17 PM

        There already is a reverse search option

        3ad3bdb4-d45d-4998-82af-cf6b6fc491f0-image.png

        P 1 Reply Last reply Jun 2, 2023, 8:27 PM Reply Quote 0
        • P
          PeterJones @Michael Pisco
          last edited by Jun 2, 2023, 8:27 PM

          @Michael-Pisco ,

          There already is a reverse search option

          Re-read the original post, not just the title: they didn’t want “search backwards in document”, they wanted “all files that do not contain”.

          1 Reply Last reply Reply Quote 1
          • M
            Mark Olson
            last edited by Jun 2, 2023, 11:15 PM

            Fairly sure that (?s-i)\A(?!.*\QYour expression\E). (or with the (?s) flag instead if ignoring case) is a rather simpler but equally effective alternative to AlanKilborn’s regular expression.

            Note that I have a . after the negative lookahead because Notepad++ sometimes ignores empty matches and this ensures that the match is not empty.

            A 1 Reply Last reply Jun 2, 2023, 11:23 PM Reply Quote 1
            • A
              Alan Kilborn @Mark Olson
              last edited by Jun 2, 2023, 11:23 PM

              @Mark-Olson said in [Wishlist] Reverse search:

              is a rather simpler but equally effective alternative to AlanKilborn’s regular expression.

              Not mine! See the linked posting.

              1 Reply Last reply Reply Quote 0
              5 out of 6
              • First post
                5/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors