我有文本文件。文件包含如下
hello:all\hareesh\ _is very bad boy
hello:all\sampath _good fellow
hello:all\hareesh\going to office very late
hello:all\Jithendra is hero
hello:all\hareesh\ _is going on vacation
hello:all\hareesh\ _is worst fellow
hello:all\Suresh_india
hello:all\hareesh\ _jaffa
所以我想要的是打印线,如果包含hareesh_的行,那么忽略剩余的情况
所以我的输出应该是(注意:不要在单词之间插入空格
hello:all\hareesh\ _is very bad boy
hello:all\hareesh\ _is going on vacation
hello:all\hareesh\ _is worst fellow
hello:all\hareesh\ _jaffa
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
objRegEx.Pattern =".{0,}" &"\b" & "hareesh" & "[^;0-9a-zA-z-~\-_=+']" & ".{0,}\n"
objRegEx.Ignorecase = true
Set objFile = objFSO.OpenTextFile("C:\Users\Hareesh\Desktop\EPB\Hari.txt", ForReading)
strTargetText = objFile.ReadAll
objFile.Close
Set colMatches = objRegEx.Execute(strTargetText)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
strText = strText & strMatch.Value
Next
End If
Wscript.Echo strText
请帮帮我
提前致谢