Replace text at the first of the specific lines? Sigil or Notepad++ Regex












1














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?










share|improve this question




















  • 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














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?










share|improve this question




















  • 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








1







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?










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 3 at 11:25









Toto

3,44591226




3,44591226










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














  • 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










1 Answer
1






active

oldest

votes


















1
















  • 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>





share|improve this answer























  • 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











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%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









1
















  • 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>





share|improve this answer























  • 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
















1
















  • 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>





share|improve this answer























  • 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














1












1








1








  • 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>





share|improve this answer
















  • 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>






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 3 at 11:28

























answered Dec 3 at 10:04









Toto

3,44591226




3,44591226












  • 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












  • @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


















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.





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.




draft saved


draft discarded














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





















































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

Сан-Квентин

Алькесар

Josef Freinademetz