Local $sFile = @ScriptDir & '\需要替换的文件.txt'
Local $Str = FileRead($sFile)
Local $sReplace = StringRegExpReplace($str, '(?i)disabled=no(.+\s+.+name=\h*(\H.+?)\h*password=\h*\2)', 'disabled=yes$1')
If Not @Error And @Extended = 0 Then Exit MsgBox(48, '注意', '没啥可换 ')
Local $Extended = @Extended
FileDelete($sFile)
If FileWrite($sFile, $sReplace) Then MsgBox(64, '完成', '成功替换 ' & $Extended & ' 处 ')
好的,谢谢啦,努力补习中....
(?i) Case-insensitivity flag. This does not operate as a group. It tells the regular expression engine to do case-insensitive matching from that point on.
\h any horizontal whitespace character.
\H any character that is not a horizontal whitespace character.
* Repeat the previous character, set or group 0 or more times. Equivalent to {0,}
2 Return array of matches including the full match (Perl / PHP style).