我正在寻找匹配正则表达式模式。我知道如果单词开头有任何符号字符( _ 除外),我的代码将不起作用。如何让它匹配以任何符号开头的单词?到目前为止,这是我的代码:
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objRegex = CreateObject("vbscript.regexp")
With objRegex
.Pattern = "(\nC_PIN\s)((\b[^\s]+\b\s){3})(\b[^\s]+\b\s)(\b[^\s]+\b\s)(\b\d\b\s)"
.Global = True
Set objFil = objFso.OpenTextFile(infilename)
strAll = objFil.ReadAll
Set objFil1 = objFso.createtextfile(outfilename)
strAll = .Replace(strAll, "$1$2$4 $5 $6 ")
End With
objFil.Close
objFil2.Close