Multiple REGEXP syntax

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
christopherc
New Member
Posts: 7
Joined: Wed Feb 08, 2006 7:08 am

Multiple REGEXP syntax

Post 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";
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post 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.
psguru
PrestoSoft
christopherc
New Member
Posts: 7
Joined: Wed Feb 08, 2006 7:08 am

Post by christopherc »

I am such a dope....
:oops:
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!!
christopherc
New Member
Posts: 7
Joined: Wed Feb 08, 2006 7:08 am

Post 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!??
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post 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?
psguru
PrestoSoft
christopherc
New Member
Posts: 7
Joined: Wed Feb 08, 2006 7:08 am

Post 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!
christopherc
New Member
Posts: 7
Joined: Wed Feb 08, 2006 7:08 am

Post 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...
}
Post Reply