정규식 도움이 필요합니다

정규식 도움이 필요합니다

다음과 같은 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

관련 정보