• Login
Community
  • Login

Regular expression captures all the data I am looking for but how can I copy that data?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 3 Posters 447 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.
  • K
    Ken Shaw
    last edited by May 26, 2022, 2:46 PM

    I have used a regular expression that captures all the data I need but I am looking for a simple way to copy or cut just that data to be used in a compare later.

    K A 2 Replies Last reply May 26, 2022, 2:51 PM Reply Quote 0
    • K
      Ken Shaw @Ken Shaw
      last edited by May 26, 2022, 2:51 PM

      @ken-shaw my company does not let me add any plugins

      P 1 Reply Last reply May 26, 2022, 2:55 PM Reply Quote 0
      • P
        PeterJones @Ken Shaw
        last edited by May 26, 2022, 2:55 PM

        @ken-shaw ,

        If you use the Mark tab of the Find/Replace/…/Mark dialog, check the Bookmark Line option and do the marking (search), then it will bookmark all matched lines. You can then use Search > Bookmark > Cut/Copy Bookmarked Lines to grab all those lines into the clipboard.

        1 Reply Last reply Reply Quote 3
        • A
          Alan Kilborn @Ken Shaw
          last edited by May 26, 2022, 3:02 PM

          @ken-shaw said in Regular expression captures all the data I am looking for but how can I copy that data?:

          used a regular expression that captures all the data I need but I am looking for a simple way to copy or cut just that data

          “captures”… Hmm, I presume you mean you have used the Mark function (and thus it is “captured” in red background) or you have the matching lines in the Search results window…

          “cut” is not possible; you’d have to change your regular expression to be a replacement op where you replace matches with nothing.

          If you need “whole line” data for what you’re doing, in addition to Peter’s method you could copy the line data from the Search results window (if that’s where you have it).

          If you have text red-marked, you could press this button:

          59198058-0f22-46bc-aa8c-5b23875866c6-image.png

          But without more specific info about what you have/need, it is hard to give the best advice.

          1 Reply Last reply Reply Quote 2
          • K
            Ken Shaw
            last edited by Ken Shaw May 26, 2022, 4:02 PM May 26, 2022, 4:00 PM

            I can mark and copy lines without issue but what I want is the specific text/data from my regular expression:

            <bookstore>
            <book category=“COOKING”><title lang=“en”>Everyday Italian</title><author>Giada De Laurentiis</author><year>2005</year><price>30.00</price></book>
            <book category=“CHILDREN”><title lang=“en”>Harry Potter</title><author>J K. Rowling</author><year>2005</year><price>29.99</price></book>
            <book category=“WEB”><title lang=“en”>Learning XML</title><author>Erik T. Ray</author><year>2003</year><price>39.95</price</book>
            </bookstore>

            I use mark with the following regular expression:
            <author>[^<>]+</author><year>[^<>]+</year>

            I see that the text/data I want is highlighted so I want to only copy that highlighted data not the whole line of data.

            It seems like there should be a simple copy highlighted text but I don’t see it.

            Also the version I have at work is 7.8.5 so what version is that copy marked text in as that would be freaking awesome

            P 1 Reply Last reply May 26, 2022, 4:42 PM Reply Quote 0
            • P
              PeterJones @Ken Shaw
              last edited by PeterJones Dec 16, 2024, 3:55 PM May 26, 2022, 4:42 PM

              @ken-shaw said in Regular expression captures all the data I am looking for but how can I copy that data?:

              Also the version I have at work is 7.8.5 so what version is that copy marked text in

              You’re using v7.8.5? The Copy Marked Text feature in the Mark dialog was added in v7.9.1. If you want this feature at work, you are going to have to ask your IT to approve a newer version of Notepad++, because v7.8.5 does not have the functionality you desire.

              I highly recommend v8.4.1 if you are upgrading, because there have been significant improvements, and v8.4.1 has been very stable. (And since you don’t use plugins, you do not have to worry about the updated plugin interface, which is the thing holding back many users from upgrading beyond v8.2.1, while they wait for their needed plugins to be made compatible with Notepad++.)

              K 1 Reply Last reply Jun 16, 2022, 6:24 PM Reply Quote 2
              • K
                Ken Shaw @PeterJones
                last edited by Jun 16, 2022, 6:24 PM

                @peterjones
                Woot my company installed the latest version of NotePad ++ so very happy

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