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 434 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.
    • Ken ShawK
      Ken Shaw
      last edited by

      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.

      Ken ShawK Alan KilbornA 2 Replies Last reply Reply Quote 0
      • Ken ShawK
        Ken Shaw @Ken Shaw
        last edited by

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

        PeterJonesP 1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @Ken Shaw
          last edited by

          @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
          • Alan KilbornA
            Alan Kilborn @Ken Shaw
            last edited by

            @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
            • Ken ShawK
              Ken Shaw
              last edited by Ken Shaw

              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

              PeterJonesP 1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Ken Shaw
                last edited by PeterJones

                @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++.)

                Ken ShawK 1 Reply Last reply Reply Quote 2
                • Ken ShawK
                  Ken Shaw @PeterJones
                  last edited by

                  @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