正規表現のヘルプが必要

正規表現のヘルプが必要

次のような 8XX 行のテキストがあります。

id="**02_item2_02" duration="29" style="**joe"
id="02_item3_01" duration="35.5" style="joseph"

id="との間のテキストはstyle="同じではありません。 と の右側id=" から までのテキストを置き換えるにはどうすればよいですか?そして含む style="なので、すべての行は次のようになります。

id="joseph" bla!bla!bla! text from the script 
id="sara" bla!bla!bla! text from the script 
et cetera. 

?

答え1

次の正規表現を使用できます:

(id=").+style="(.+)

次のように置き換えます:

$1$2 blah blah blah! text from the script

テスト:https://regex101.com/r/Z3zuIR/3

関連情報