- sFile = "a.htm"
- set fso = CreateObject("Scripting.FilesystemObject")
- s = fso.OpenTextFile(sFile).ReadAll
- set regEx = new regExp
- regEx.Pattern = "^.*href=""?(/?(?:\w+/)+(\w+\.css)).*$"
- regEx.IgnoreCase = True
- regEx.Global = True
- regEx.Multiline = True
- Set Matches = regEx.Execute(s)
- For Each Match in Matches
- t = t & Replace( Match.Value, Match.SubMatches(0), _
- "cmspath/" & Match.SubMatches(1) ) & vbLf
- Next
- s = Replace(s, "</head>", t & "</head>")
- 'wsh.echo s
- fso.OpenTextFile("a2.htm",2,true).Write s
- '确认无误后可直接将"a2.htm"换成sFile
复制代码 http://www.bathome.net/forum-16-1.html |