标题: [问题求助] vbs脚本怎样自动匹配文件名? [打印本页]
作者: zxcvb888 时间: 2013-1-14 22:56 标题: vbs脚本怎样自动匹配文件名?
想要自动匹配文件名0123200300100010001=0123-2003-001-0001-0001,如何编写?
作者: batman 时间: 2013-1-15 00:09
- Dim FileName
- FileName = "0123200300100010001"
- WScript.Echo RegText(FileName)
-
- Function RegText(RegStr)
- Dim RegEx
- Set RegEx = New RegExp
- RegEx.Pattern = "(\d{4})(\d{4})(\d{3})(\d{4})(\d{4})"
- RegText = RegEx.Replace(RegStr, "$1-$2-$3-$4-$5")
- Set RegEx = Nothing
- End Function
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |