本帖最后由 Nsqs 于 2023-8-14 14:33 编辑
用PowerShell替换不好么?
PowerShell:- $a='
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title></title>
- '
- [regex]::Replace($a,'(?<=<title>)(?=</title>)','你想修改什么?')
复制代码 bat:- @echo off&powershell -noprofile -ExecutionPolicy ByPass "function read($skip){((gc '%~0')-split '\n'|select -Skip $skip|Out-String)};$line=[regex]::Matches((read 1),'<#').index-1;read $line|%%{[regex]::Replace($_,'(?<=<title>)(?=</title>)','你想修改什么?')}"&pause&exit
- <#
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title></title>
- #>
复制代码 |