再来个vbs版的- option explicit
- dim class1, class2, class3, class4, str1, str2
- set class1 = createobject("scripting.filesystemobject")
- set class2 = class1.opentextfile("123.txt")
- set class4 = class1.createtextfile("new.txt", 2)
- do until class2.atendofstream
- str1 = class2.readall
- for each str2 in func1(str1)
- class4.writeline str2
- next
- loop
-
- function func1(str)
- set class3 = new regexp
- class3.pattern = "\d{13}"
- class3.global = true
- set func1 = class3.execute(str)
- end function
复制代码
|