shounei 发表于 2011-5-20 21:50:47

获取指定数组长度问题

本帖最后由 shounei 于 2011-5-20 22:14 编辑

请教怎么获取某文件里面的CMSn后面括号里面数组的长度
文件内容如下

2011-05-20 21:40:04.375 -> CDodonewDlg::DestroyBrowser
2011-05-20 21:40:04.421 -> SC_MINIMIZE
2011-05-20 21:40:04.453 -> CDodonewDlg::DestroyWindow
2011-05-20 21:40:04.453 -> OnDodoNewClose
2011-05-20 21:40:09.156 -> SureName:computerName,IP,RznSn(Hex)[],CMSn,idType,AuditId[],AutitType
2011-05-20 21:40:09.187 -> AuditProxyIP: 192.168.0.252
2011-05-20 21:40:10.109 -> CSureNameThread::DoLogon: failure, 192.168.0.252
2011-05-20 21:40:11.171 -> ConsumeAmount:0
2011-05-20 21:40:11.187 -> UsedMoney:0

3mile 发表于 2011-5-20 22:04:14

\[\d{5,}\]

shounei 发表于 2011-5-20 22:20:14

就是不知道用StringRegExp怎么表达

shounei 发表于 2011-5-20 22:41:58

2楼的能不能说明白点呀!新手看不懂哟,想了办天

水木子 发表于 2011-5-20 22:45:02

回复 3# shounei

$sText = FileRead('Text.txt') ;某文件
$aSre = StringRegExp($sText, '(?<=CMSn\[)[^\]]+', 3)
If IsArray($aSre) Then MsgBox(0, '', $aSre)
页: [1]
查看完整版本: 获取指定数组长度问题