Notepad++ delete until colon for every line with replace all
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
New contributor
add a comment |
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
New contributor
add a comment |
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
New contributor
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
notepad++ regex
New contributor
New contributor
New contributor
asked 3 hours ago
teoweyteowey
484
484
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
1
+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
1 hour ago
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
1 hour ago
add a comment |
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
});
}
});
teowey is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
1
+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
1 hour ago
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
1 hour ago
add a comment |
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
1
+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
1 hour ago
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
1 hour ago
add a comment |
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
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
answered 3 hours ago
TotoToto
4,175101226
4,175101226
1
+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
1 hour ago
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
1 hour ago
add a comment |
1
+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
1 hour ago
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
1 hour ago
1
1
+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
1 hour ago
+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
1 hour ago
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
1 hour ago
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
1 hour ago
add a comment |
teowey is a new contributor. Be nice, and check out our Code of Conduct.
teowey is a new contributor. Be nice, and check out our Code of Conduct.
teowey is a new contributor. Be nice, and check out our Code of Conduct.
teowey is a new contributor. Be nice, and check out our Code of Conduct.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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