需要正規表示式幫助

需要正規表示式幫助

我有一個 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

相關內容