Community
    • Login

    Regex multiple line search + redirect search results / possible improvement?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 2.1k 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.
    • Marco FabbriM
      Marco Fabbri
      last edited by Marco Fabbri

      Hi,
      I use quite often the regex search on multiple line.

      but I found a couple of limitation:

      1. The results frame shows only the first line for the matched text block . In some case this limitation is useful though, especially when a pattern matches many large text blocks. In some cases it would be useful to select the behavior or at least to export the output to a new tab (see point 2)

      2. it could be useful to have an option in the search window to export the search results to a new tab .

      Do you know if either the above feature can be implemented or a plugin already exists? I spent some time without any luck.
      I know could use grep or its variants but it would be handy to have those options.

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Marco Fabbri
        last edited by

        @Marco-Fabbri

        I don’t know if you are just making feature requests, or if you might be interested in workarounds.

        • For feature requests, it might be better to do it here

        • For workarounds on the topic you raise, you might have a look here.

        1 Reply Last reply Reply Quote 0
        • Marco FabbriM
          Marco Fabbri
          last edited by

          Thanks for your comment Scott,

          I filed an enhancement request.
          https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3569

          Regarding the workaround, I am still not sure if that is what I was looking for…I have to learn how to run a python script in N++ first :)

          1 Reply Last reply Reply Quote 0
          • Marco FabbriM
            Marco Fabbri
            last edited by Marco Fabbri

            Just as a reference…
            The quickest workaround I found is to use a cygwin shell with “pcre” package installed…
            $ pcregrep -M “BGP neighbor is.\r\n.\r\n.\r\n.\r\n.*\r\n.*state.*Established.*3w” file.txt

            (the above example look for a 6 lines string block such as:

            BGP neighbor is xxxx
            Remote AS xx, local AS xx, internal link
            Description: xxxx
            Remote router ID xxxx
            Cluster ID xxxx
            BGP **state **= Established, up for 3w5d

            hope this helps.

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