Replace all words that start with @ by another word
So, basicly, I need to edit something like this:
@john TEST TEST TEST
@andrew EXAMPLE EXAMPLE
@geady JK JK JK
and I need to replace all of them to get like this:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
How can I achieve this with notepad++? Thanks in advance!
notepad++ regex
add a comment |
So, basicly, I need to edit something like this:
@john TEST TEST TEST
@andrew EXAMPLE EXAMPLE
@geady JK JK JK
and I need to replace all of them to get like this:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
How can I achieve this with notepad++? Thanks in advance!
notepad++ regex
add a comment |
So, basicly, I need to edit something like this:
@john TEST TEST TEST
@andrew EXAMPLE EXAMPLE
@geady JK JK JK
and I need to replace all of them to get like this:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
How can I achieve this with notepad++? Thanks in advance!
notepad++ regex
So, basicly, I need to edit something like this:
@john TEST TEST TEST
@andrew EXAMPLE EXAMPLE
@geady JK JK JK
and I need to replace all of them to get like this:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
How can I achieve this with notepad++? Thanks in advance!
notepad++ regex
notepad++ regex
edited Dec 6 at 15:14
Hashim
3,01063056
3,01063056
asked Dec 6 at 13:46
pedroribeiro98
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Ctrl+H
- Find what:
@w+
- Replace with:
@replaced
- check Wrap around
- check Regular expression
- Replace all
Explanation:
@ # literally
w+ # 1 or more word character (i.e. [a-zA-Z0-9_])
You may use S+ if you want to match any character that is not a space
Result for given example:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
|
show 2 more comments
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
});
}
});
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%2f1381347%2freplace-all-words-that-start-with-by-another-word%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
Ctrl+H
- Find what:
@w+
- Replace with:
@replaced
- check Wrap around
- check Regular expression
- Replace all
Explanation:
@ # literally
w+ # 1 or more word character (i.e. [a-zA-Z0-9_])
You may use S+ if you want to match any character that is not a space
Result for given example:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
|
show 2 more comments
Ctrl+H
- Find what:
@w+
- Replace with:
@replaced
- check Wrap around
- check Regular expression
- Replace all
Explanation:
@ # literally
w+ # 1 or more word character (i.e. [a-zA-Z0-9_])
You may use S+ if you want to match any character that is not a space
Result for given example:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
|
show 2 more comments
Ctrl+H
- Find what:
@w+
- Replace with:
@replaced
- check Wrap around
- check Regular expression
- Replace all
Explanation:
@ # literally
w+ # 1 or more word character (i.e. [a-zA-Z0-9_])
You may use S+ if you want to match any character that is not a space
Result for given example:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
Ctrl+H
- Find what:
@w+
- Replace with:
@replaced
- check Wrap around
- check Regular expression
- Replace all
Explanation:
@ # literally
w+ # 1 or more word character (i.e. [a-zA-Z0-9_])
You may use S+ if you want to match any character that is not a space
Result for given example:
@replaced TEST TEST TEST
@replaced EXAMPLE EXAMPLE
@replaced JK JK JK
edited Dec 6 at 15:06
answered Dec 6 at 14:04
Toto
3,47091226
3,47091226
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
|
show 2 more comments
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
Thanks for your answer, although it didn't worked 100% for me... I'm using: Find what: @S+ Replace with: @replacedL$0 And I get: @replaced@john TEST TEST TEST
– pedroribeiro98
Dec 6 at 14:27
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
@pedroribeiro98: Could you show some cases that don't work?
– Toto
Dec 6 at 14:28
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
I just edit my comment above @Toto. Thanks for the help
– pedroribeiro98
Dec 6 at 14:29
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
@pedroribeiro98: Please, edit your question and add some test cases with expected result.
– Toto
Dec 6 at 14:39
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
I think it's clear, I want to replace the word that starts with @, so instead of getting [@john] , I get [@replaced] , but with your solution, I'm getting [@replaced@john]
– pedroribeiro98
Dec 6 at 14:43
|
show 2 more comments
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f1381347%2freplace-all-words-that-start-with-by-another-word%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