Dim pat, patparts, rxp, inp
pat = WScript.Arguments(0)
patparts = Split(pat,"/")
Set rxp = new RegExp
rxp.Global = True
rxp.Multiline = False
rxp.Pattern = patparts(1)
Do While Not WScript.StdIn.AtEndOfStream
inp = WScript.StdIn.ReadLine()
WScript.Echo rxp.Replace(inp, patparts(2))
Loop
有一个 Windows 的帮助器批处理文件称为 repl.bat,它具有 SED 的大部分功能,但 doesn't require any additional download或安装。它是一个混合的批处理文件,使用 Jscript实现的功能,因此是 swift,和 doesn't suffer from the usual poison characters的批处理和处理空白行轻松。