I am not sure if this is the right place or whether there is a forum for reg expressions
Situation:I have a folder windows that has files starting
with timings1_0.csv thru timings1_9.csv and the pattern repeats like timings5_4.csv ,timings3_1.csv ,I guess you get the idea.I am constrained by my programming environment,I cannot use anything other than vbscript which is version5.6,So I started with aregexp pattern which is as under.What I want is a pattern that can pick up a "zero" 0 in a file name and the file has to start with "timing".The below pattern does pick up "0"'s but being devils advocate
I put a file called "pimings1_0.csv" and my regexp picked that also as a candidate.So obviously I am doing my pat match wrongly,but cannot figure it out.
Situation:I have a folder windows that has files starting
with timings1_0.csv thru timings1_9.csv and the pattern repeats like timings5_4.csv ,timings3_1.csv ,I guess you get the idea.I am constrained by my programming environment,I cannot use anything other than vbscript which is version5.6,So I started with aregexp pattern which is as under.What I want is a pattern that can pick up a "zero" 0 in a file name and the file has to start with "timing".The below pattern does pick up "0"'s but being devils advocate
I put a file called "pimings1_0.csv" and my regexp picked that also as a candidate.So obviously I am doing my pat match wrongly,but cannot figure it out.
Set re = new regexp
re.pattern ="T*0\.csv"
re.IgnoreCase = true
re.Global = true
expressionmatch=re.Test(oFile.Name)
in the above example oFile.Name will be replaced by code as
pimings1_0.csv and so on and I have a wscript.echo statement telling me it has found a match or not.
If one of the vbscript gurus can help me why the expression is going wrong or share your experiences about its reliabilty.
Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937