使用如下代码进行正则运算,其中Pattern和TXT值都未改变,但有时候工作正常,能得到返回值,有时候却无结果,返回空值,这是怎么回事? RE:= TRegExp.Create(nil);
RE.Global := true;
RE.IgnoreCase := true;
RE.Pattern :=Pattern;
try
machs := RE.Execute(txt) as IMatchCollection;
except
end;
//RE.Free;
FreeAndNil(RE);
RE.Global := true;
RE.IgnoreCase := true;
RE.Pattern :=Pattern;
try
machs := RE.Execute(txt) as IMatchCollection;
except
end;
//RE.Free;
FreeAndNil(RE);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货