VBS正则表达式

删除字符串中指定的内容

Dim pathStr, newPathStr
pathStr = "c:\windows;%My%\tool;e:\test;%Tg%\ff;d:\mm"
set regEx = New RegExp
regEx.Pattern = ";%[a-zA-Z]+%(\\[a-zA-Z]+)*"
regEx.Global = True
newPathStr = regEx.Replace(pathStr, "")
MsgBox(newPathStr)

 

posted on 2013-09-07 22:52  应无所住而生其心  阅读(262)  评论(0编辑  收藏  举报

导航