Notepad++ delete until colon for every line with replace all





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







18















I'm using Notepad++ Replace box to delete text to the left of the colon (:) in all 3 lines of my file:




TRACE: do



TRACE: re



TRACE: mi




I'm using ^[^:]+: in the 'Find what:' field and 'Replace with:' is empty but when it goes to the next line it automatically selects and deletes what was output in the previous line, so when I run Replace All it results in:




mi




It should show:




do



re



mi











share|improve this question





























    18















    I'm using Notepad++ Replace box to delete text to the left of the colon (:) in all 3 lines of my file:




    TRACE: do



    TRACE: re



    TRACE: mi




    I'm using ^[^:]+: in the 'Find what:' field and 'Replace with:' is empty but when it goes to the next line it automatically selects and deletes what was output in the previous line, so when I run Replace All it results in:




    mi




    It should show:




    do



    re



    mi











    share|improve this question

























      18












      18








      18


      1






      I'm using Notepad++ Replace box to delete text to the left of the colon (:) in all 3 lines of my file:




      TRACE: do



      TRACE: re



      TRACE: mi




      I'm using ^[^:]+: in the 'Find what:' field and 'Replace with:' is empty but when it goes to the next line it automatically selects and deletes what was output in the previous line, so when I run Replace All it results in:




      mi




      It should show:




      do



      re



      mi











      share|improve this question














      I'm using Notepad++ Replace box to delete text to the left of the colon (:) in all 3 lines of my file:




      TRACE: do



      TRACE: re



      TRACE: mi




      I'm using ^[^:]+: in the 'Find what:' field and 'Replace with:' is empty but when it goes to the next line it automatically selects and deletes what was output in the previous line, so when I run Replace All it results in:




      mi




      It should show:




      do



      re



      mi








      notepad++ regex






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 2 at 12:28









      teoweyteowey

      937




      937






















          1 Answer
          1






          active

          oldest

          votes


















          22














          It's a "bug" ("feature") of Notepad++, you have to capture the rest of the line and use the value in replace:




          • Find what: ^[^:]+:(.+)$

          • Replace with: $1

          • check Wrap around

          • check Regular expression

          • UNCHECK . matches newline

          • Replace all


          Another way is:




          • Find what: ^[^:rn]+:

          • Replace with: LEAVE EMPTY






          share|improve this answer



















          • 5





            +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

            – Graham
            Apr 2 at 14:27








          • 3





            Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

            – Graham
            Apr 2 at 14:56








          • 3





            I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

            – Carl Witthoft
            Apr 2 at 17:43






          • 2





            Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

            – Nayuki
            Apr 2 at 18:46











          • This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

            – Yay295
            Apr 3 at 5:40












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1420401%2fnotepad-delete-until-colon-for-every-line-with-replace-all%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          22














          It's a "bug" ("feature") of Notepad++, you have to capture the rest of the line and use the value in replace:




          • Find what: ^[^:]+:(.+)$

          • Replace with: $1

          • check Wrap around

          • check Regular expression

          • UNCHECK . matches newline

          • Replace all


          Another way is:




          • Find what: ^[^:rn]+:

          • Replace with: LEAVE EMPTY






          share|improve this answer



















          • 5





            +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

            – Graham
            Apr 2 at 14:27








          • 3





            Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

            – Graham
            Apr 2 at 14:56








          • 3





            I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

            – Carl Witthoft
            Apr 2 at 17:43






          • 2





            Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

            – Nayuki
            Apr 2 at 18:46











          • This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

            – Yay295
            Apr 3 at 5:40
















          22














          It's a "bug" ("feature") of Notepad++, you have to capture the rest of the line and use the value in replace:




          • Find what: ^[^:]+:(.+)$

          • Replace with: $1

          • check Wrap around

          • check Regular expression

          • UNCHECK . matches newline

          • Replace all


          Another way is:




          • Find what: ^[^:rn]+:

          • Replace with: LEAVE EMPTY






          share|improve this answer



















          • 5





            +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

            – Graham
            Apr 2 at 14:27








          • 3





            Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

            – Graham
            Apr 2 at 14:56








          • 3





            I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

            – Carl Witthoft
            Apr 2 at 17:43






          • 2





            Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

            – Nayuki
            Apr 2 at 18:46











          • This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

            – Yay295
            Apr 3 at 5:40














          22












          22








          22







          It's a "bug" ("feature") of Notepad++, you have to capture the rest of the line and use the value in replace:




          • Find what: ^[^:]+:(.+)$

          • Replace with: $1

          • check Wrap around

          • check Regular expression

          • UNCHECK . matches newline

          • Replace all


          Another way is:




          • Find what: ^[^:rn]+:

          • Replace with: LEAVE EMPTY






          share|improve this answer













          It's a "bug" ("feature") of Notepad++, you have to capture the rest of the line and use the value in replace:




          • Find what: ^[^:]+:(.+)$

          • Replace with: $1

          • check Wrap around

          • check Regular expression

          • UNCHECK . matches newline

          • Replace all


          Another way is:




          • Find what: ^[^:rn]+:

          • Replace with: LEAVE EMPTY







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 2 at 12:34









          TotoToto

          4,419101328




          4,419101328








          • 5





            +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

            – Graham
            Apr 2 at 14:27








          • 3





            Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

            – Graham
            Apr 2 at 14:56








          • 3





            I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

            – Carl Witthoft
            Apr 2 at 17:43






          • 2





            Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

            – Nayuki
            Apr 2 at 18:46











          • This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

            – Yay295
            Apr 3 at 5:40














          • 5





            +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

            – Graham
            Apr 2 at 14:27








          • 3





            Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

            – Graham
            Apr 2 at 14:56








          • 3





            I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

            – Carl Witthoft
            Apr 2 at 17:43






          • 2





            Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

            – Nayuki
            Apr 2 at 18:46











          • This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

            – Yay295
            Apr 3 at 5:40








          5




          5





          +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

          – Graham
          Apr 2 at 14:27







          +1. Originally, I though NP++'s implementation was fine, but I tested this Python example, and found that NP++ is indeed irregular by retaining position after a lookbehind is evaluated. Learn something new every day! I lack time now, but I can probably file an issue in their GitHub repo later (there's no related issue currently open).

          – Graham
          Apr 2 at 14:27






          3




          3





          Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

          – Graham
          Apr 2 at 14:56







          Not to mention that it's misleading because it's inconsistent with other components of the find-and-replace tab, like what's shown to the user when previewing a change via the "Find" or "Mark". (Side note: I find "Mark" to be particularly useful when drafting regex to ensure I haven't made a silly mistake.) Really I'm starting to think I should switch text editors or start contributing my own bug fixes to Notepad++, since there are actually a surprising number of miscellaneous issues. But I guess that's probably the case for any dedicated program user like myself.

          – Graham
          Apr 2 at 14:56






          3




          3





          I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

          – Carl Witthoft
          Apr 2 at 17:43





          I like the second approach better -- it looks like it should work in almost any "altered implementation" of regex interpretation.

          – Carl Witthoft
          Apr 2 at 17:43




          2




          2





          Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

          – Nayuki
          Apr 2 at 18:46





          Even shorter, by using a reluctant quantifier: Replace ^.*?: with empty. (Docs)

          – Nayuki
          Apr 2 at 18:46













          This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

          – Yay295
          Apr 3 at 5:40





          This has to be a bug. ^[^:]*?: and ^.*?: should do exactly the same thing, but they don't. ^[^:rn]*?: does work correctly though, so I'd guess that's where the issue is, somehow. The same issue occurs with ^.*?: if you check the ". matches newline" box.

          – Yay295
          Apr 3 at 5:40


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1420401%2fnotepad-delete-until-colon-for-every-line-with-replace-all%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          Origin of the phrase “under your belt”?