Como posso substituir o texto na primeira linha específica
Exemplo antes:
<p>– Your mother created a song?</p>
<p>– She was a pianist.</p>
<p>– Okay then, let us hear the song.</p>
E eu quero ser assim
<p>"Your mother created a song?"
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
Existe uma maneira de fazer isso na área de texto selecionada, talvez com regex?
Responder1
- Ctrl+H
- Encontre o que:
(?<=<p>)– (.+)(?=</p>)
- Substituir com:
"$1"
- confira Envolver
- verifique expressão regular
- DESMARCAR
. matches newline
- Replace all
Explicação:
(?<=<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
Substituição:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
Resultado para determinado exemplo:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>