Replace text at the first of the specific lines? Sigil or Notepad++ Regex
up vote
1
down vote
favorite
How can I replace text at the first of specific lines
Example before:
<p>– Your mother created a song?</p>
<p>– She was a pianist.</p>
<p>– Okay then, let us hear the song.</p>
And i want to be like this
<p>"Your mother created a song?"
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Is there a way to do it in selected text area maybe with regex?
notepad++ regex sigil
add a comment |
up vote
1
down vote
favorite
How can I replace text at the first of specific lines
Example before:
<p>– Your mother created a song?</p>
<p>– She was a pianist.</p>
<p>– Okay then, let us hear the song.</p>
And i want to be like this
<p>"Your mother created a song?"
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Is there a way to do it in selected text area maybe with regex?
notepad++ regex sigil
1
To be clear, you want to remove the–
at the beginning of each line and suround all lines with quotes?
– Toto
Dec 3 at 9:58
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
How can I replace text at the first of specific lines
Example before:
<p>– Your mother created a song?</p>
<p>– She was a pianist.</p>
<p>– Okay then, let us hear the song.</p>
And i want to be like this
<p>"Your mother created a song?"
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Is there a way to do it in selected text area maybe with regex?
notepad++ regex sigil
How can I replace text at the first of specific lines
Example before:
<p>– Your mother created a song?</p>
<p>– She was a pianist.</p>
<p>– Okay then, let us hear the song.</p>
And i want to be like this
<p>"Your mother created a song?"
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Is there a way to do it in selected text area maybe with regex?
notepad++ regex sigil
notepad++ regex sigil
edited Dec 3 at 11:25
Toto
3,40191126
3,40191126
asked Dec 3 at 9:12
Aris Munandar
82
82
1
To be clear, you want to remove the–
at the beginning of each line and suround all lines with quotes?
– Toto
Dec 3 at 9:58
add a comment |
1
To be clear, you want to remove the–
at the beginning of each line and suround all lines with quotes?
– Toto
Dec 3 at 9:58
1
1
To be clear, you want to remove the
–
at the beginning of each line and suround all lines with quotes?– Toto
Dec 3 at 9:58
To be clear, you want to remove the
–
at the beginning of each line and suround all lines with quotes?– Toto
Dec 3 at 9:58
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Ctrl+H
- Find what:
(?<=<p>)– (.+)(?=</p>)
- Replace with:
"$1"
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
(?<=<p>) # positive lookbehind, make sure we have <p> before
– # – character followed by a space
(.+) # group 1, any character nut newline
(?=</p>) # positive lookahead, make sure we have </p> after
Replacement:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
Result for given example:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
@ArisMunandar: I have updated the answer to deal with<p>
tags.
– Toto
Dec 3 at 11:29
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
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',
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%2f1380350%2freplace-text-at-the-first-of-the-specific-lines-sigil-or-notepad-regex%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
up vote
1
down vote
accepted
Ctrl+H
- Find what:
(?<=<p>)– (.+)(?=</p>)
- Replace with:
"$1"
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
(?<=<p>) # positive lookbehind, make sure we have <p> before
– # – character followed by a space
(.+) # group 1, any character nut newline
(?=</p>) # positive lookahead, make sure we have </p> after
Replacement:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
Result for given example:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
@ArisMunandar: I have updated the answer to deal with<p>
tags.
– Toto
Dec 3 at 11:29
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
add a comment |
up vote
1
down vote
accepted
Ctrl+H
- Find what:
(?<=<p>)– (.+)(?=</p>)
- Replace with:
"$1"
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
(?<=<p>) # positive lookbehind, make sure we have <p> before
– # – character followed by a space
(.+) # group 1, any character nut newline
(?=</p>) # positive lookahead, make sure we have </p> after
Replacement:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
Result for given example:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
@ArisMunandar: I have updated the answer to deal with<p>
tags.
– Toto
Dec 3 at 11:29
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Ctrl+H
- Find what:
(?<=<p>)– (.+)(?=</p>)
- Replace with:
"$1"
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
(?<=<p>) # positive lookbehind, make sure we have <p> before
– # – character followed by a space
(.+) # group 1, any character nut newline
(?=</p>) # positive lookahead, make sure we have </p> after
Replacement:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
Result for given example:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Ctrl+H
- Find what:
(?<=<p>)– (.+)(?=</p>)
- Replace with:
"$1"
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
(?<=<p>) # positive lookbehind, make sure we have <p> before
– # – character followed by a space
(.+) # group 1, any character nut newline
(?=</p>) # positive lookahead, make sure we have </p> after
Replacement:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
Result for given example:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
edited Dec 3 at 11:28
answered Dec 3 at 10:04
Toto
3,40191126
3,40191126
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
@ArisMunandar: I have updated the answer to deal with<p>
tags.
– Toto
Dec 3 at 11:29
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
add a comment |
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
@ArisMunandar: I have updated the answer to deal with<p>
tags.
– Toto
Dec 3 at 11:29
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
Thank you, it's work on notepad++, but on sigil ( html) it's not work here example text <p>– Your mother created a song?</p> <p>– She was a pianist.</p> <p>– Okay then, let us hear the song.</p> and i want like this <p>"Your mother created a song?</p> <p>"She was a pianist.</p> <p>"Okay then, let us hear the song."</p>
– Aris Munandar
Dec 3 at 11:16
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
@ArisMunandar: You've ask for a regex for Notepad++ or Sigil. I don't know sigil, may it doesn't understand regex.
– Toto
Dec 3 at 11:21
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
sigil is like ebook (epub) editor, where you can edit ebook using html. but it's okay now, it's worked while trying your code and with little edit. Thank you!
– Aris Munandar
Dec 3 at 11:27
@ArisMunandar: I have updated the answer to deal with
<p>
tags.– Toto
Dec 3 at 11:29
@ArisMunandar: I have updated the answer to deal with
<p>
tags.– Toto
Dec 3 at 11:29
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
Thank you, you've saved me!
– Aris Munandar
Dec 3 at 11:43
add a comment |
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%2f1380350%2freplace-text-at-the-first-of-the-specific-lines-sigil-or-notepad-regex%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
1
To be clear, you want to remove the
–
at the beginning of each line and suround all lines with quotes?– Toto
Dec 3 at 9:58