Page 1 of 1
Multiple REGEXP syntax
Posted: Thu Apr 13, 2006 5:16 am
by christopherc
Hi,
I need to add two RegExp statements for exclusions to the output file.
Problem is I get two file patterns that always differ and want the report not to generate those diffs. The two patters are 'server[0-9]{4,5}.xml.*' and 'tmp.*'.
How can I get the RegExp syntax in ExamDiff to do this? I can run 1 or the other but not both in the same syntax.
WScript statement I use is:
" \"c:\\Program Files\\ExamDiff Pro\\ExamDiff.exe\" " + sFile1 + " " + sFile2 + " /j:(server[0-9]{4,5}) /o:" + sOutputFile + " /no";
Posted: Thu Apr 13, 2006 8:49 am
by psguru
Are you trying to exclude files matching certain patterns? If so, you should use "fx" option, which should also allow you to specify multiple comma-separated patterns.
If you are trying to exclude certain lines that match regular expressions, use "j" option with vertical bar character ("|") to denote OR relationship between individual regular expressions.
Posted: Thu Apr 13, 2006 9:49 am
by christopherc
I am such a dope....
I was doing this wondering "Why is there no output file???" when in fact I specified to only generate an output file if there is diffs found (/o option).
I was working all along and just realized it. Sorry!!
Posted: Thu Apr 13, 2006 10:12 am
by christopherc
Maybe not... I removed the /no to not output a file, altered the /j parameter, and changed the code as follows:
sExamDiff = " \"c:\\Program Files\\ExamDiff Pro\\ExamDiff.exe\" " + sFile1 + " " + sFile2 + " /j:tmp.*|server[0-9]{4,5}.* /o:" + sOutputFile;
sCmd = "cmd /c ";
oRunningProcess = WshShell.Exec(sCmd + sExamDiff);
while (oRunningProcess.Status == 0)
{
Application.Sleep(1);
}
If I run them now the command window just "flashes", and no output file. I even altered the 2nd expresssion to "fail" (ie. 'blah[0-9]{4,5}') and no output is generated.
Help!??
Posted: Thu Apr 13, 2006 11:00 am
by psguru
Can you output the resulting command line from your script and run it separately from the command prompt? Could you, if it doesn't work, also post it here?
Posted: Thu Apr 13, 2006 12:30 pm
by christopherc
Command line works. If I get it working I'll post it back in case anyone else might benefit.
Thank you for the help!
Posted: Mon Apr 17, 2006 6:39 am
by christopherc
The problem is the way the command was built. The syntax should be as follows (JScript) and it works. I hope this will help someone... :>)
sExamDiff = "\"c:\\program files\\examdiff pro\\examdiff.exe\"";
oRunningProcess = WshShell.Exec(sExamDiff + " " + sFile1 + " "+sFile2 + " /j:tmp.*|server[0-9]{4,5}.* "+ " /o:" + sOutputFile+" /no");;
while (oRunningProcess.Status == 0)
{
//Sleep for 1 second....
}
if (objFSO.FileExists(sOutputFile))
{
//Do something if there is a file output...
}
else
{
//Do something if no file output...
}