需要从这个巨大的字符串(1618252)中获取作业 ID,并且没有正则表达式来执行此操作,因为当找不到作业 ID 时它可能会失败----------
% set invoc [[$this cget -testrun] cget -invocation]
tcl profilemgr -configNetwork {} -startBefore now -releaseUnusedEquip 0 \
-profile ptse1-bsd2 -noreserve 0 -noreplace 0 \
-comment {<a href="/testrunscheduler/schedulerJob.rvt?job_id=1618252">Profile Push: 1618252</a>} \
-attr {} -dur 300minutes -controlAssert 0 -roleSubst {} -offline false -nodb 0 \
-image {} -layer2Mode mapping -checkLeaks 0 -config {} -trace 0 -debug 0 -desc 0 \
-notify 0 -forceProfileIP false -clusterHashingMode simple -doConfig true \
-reservation 0 -projects pts_7_20-latest -flavor {} -platformMix {} \
-releaseReservation 0 -pkgExt {} -emails {} -loadBalancingMode none -enableIOM false \
-checkConn 1 -platform ptsvpl-esxi-lnx -pkgView {} -offlineFailedConn 1 -noall 0 \
-ipMode ipv4 -runType pmgr-run -enableUdpPrioritization false \
-params {profilemgr:profileToPush "ptse1-bsd2" profilemgr:platform "ptsvpl-esxi-lnx"} \
-swtc_view /m/vmurshilly_lab \
{<br>Invocation with all defaults removed => tcl profilemgr -profile "ptse1-bsd2" -comment "<a href="/testrunscheduler/schedulerJob.rvt?job_id=1618252">Profile Push: 1618252</a>" -dur "300minutes" -projects "pts_7_20-latest" -platform "ptsvpl-esxi-lnx" -offlineFailedConn "1"}
我尝试使用失败的正则表达式本身:
~$tcl
% regexp -all .*job_id=(.*)\"> "supercalafrajilistic" match jobID
0
% puts $jobID
can't read "jobID": no such variable
while evaluating {puts $jobID}