Forum Discussion
VLapidus
15 years agoFrequent Contributor
Hi,
You can use the example from the link:
http://smartbear.com/support/viewarticle/8963/
In the code, you need to modify the Test function:
function ParseIP(TextOutput);
You can use the example from the link:
http://smartbear.com/support/viewarticle/8963/
In the code, you need to modify the Test function:
contents := 'Execution result: ' + ExecAndWaitForEnd('ping', 'ComputerName'));
Then, you will be able to extract the Ip from the contents
function ParseIP(TextOutput);
var
MyRegExp: OleVariant;
ResStr: String;
begin
MyRegExp:=HISUtils.RegExpr;
ResStr:='';
MyRegExp.Expression:='(\d{1,3}\.){3}\d{1,3}';
if
MyRegExp.Exec(TextOutput) then
ResStr :=
MyRegExp.Match[0];
result := ResStr;
end;