特定の行の最初のテキストを置き換えるにはどうすればよいですか
前の例:
<p>– Your mother created a song?</p>
<p>– She was a pianist.</p>
<p>– Okay then, let us hear the song.</p>
そして、私はこのようになりたい
<p>"Your mother created a song?"
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>
おそらく正規表現を使用して、選択したテキスト領域でそれを行う方法はありますか?
(?<=<p>)– (.+)(?=</p>)
"$1"
. matches newline
説明:
(?<=<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
交換:
" # a double quote
$1 # content of group 1, the sentence
" # a double quote
与えられた例の結果:
<p>"Your mother created a song?"</p>
<p>"She was a pianist."</p>
<p>"Okay then, let us hear the song."</p>