Login | |
|
 |
RE: using the preceding character in a search string. - 5/15/2008 12:19:24 AM
|
|
 |
|
| |
ebgreen
Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
|
See if this gets you going in the right direction: Set fso = CreateObject("Scripting.FileSystemObject") set logfile = fso.OpenTextFile("C:\Temp\foo.txt", 1, True) Do until logfile.AtEndOfStream Set RegEx = New RegExp RegEx.Pattern = "(\d*)(F2F|FTF|Face To Face|Facetoface|QC|Quality Control)" RegEx.IgnoreCase = True RegEx.Global = True nextline = logfile.ReadLine Set expressionmatch = RegEx.Execute(nextline) If expressionmatch.Count > 0 Then For Each expressionmatched in expressionmatch If expressionmatched.Submatches(0) <> "" Then WScript.Echo expressionmatched.Submatches(0) & " - " & expressionmatched.Submatches(1) Else WScript.Echo "1 - " & expressionmatched.Value End If 'foundat = (expressionmatched.FirstIndex)-1 'MyString = (Mid(nextline,foundat,1)) 'msgbox mystring Next End
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|