#include <Array.au3>
Local $Str = _
'6/1/2011 8:56:9 - PFRO Error: \??\C:\Users\Administrator\AppData\Roaming\Tencent\QQ\AUTemp\L(2T]}%BH7%I09CDJV@V0B1\1305880992493657663, |delete operation|, 0xc0000101' & @CRLF & _
'6/1/2011 8:56:9 - 8 Successful PFRO operations' & @CRLF & @CRLF & _
'6/4/2011 9:6:8 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\12074065\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:8 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\4f7aec4d\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:8 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\5f7adcac\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\9194849a\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\dee01ee0\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Program Files (x86)\Common Files\Tencent\QQPhotoDrawEx\QQPhotoDrawEx.2.27.171.429.dll, |delete operation|, 0xc0000034' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\4e68af1b\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\829fb9ce\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Program Files (x86)\Common Files\Tencent\QQPhotoDrawEx\QQPhotoDrawEx.2.27.171.429.dll, |delete operation|, 0xc0000034' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\dd63124c\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\801dbe41\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\821fb8ef\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\cde02309\, |delete operation|, 0xc0000101' & @CRLF & _
'6/4/2011 9:6:9 - 1 Successful PFRO operations' & @CRLF & @CRLF & _
'6/5/2011 10:2:53 - PFRO Error: \??\C:\ProgramData\Tencent\QQPinyin\Repair\, |delete operation|, 0xc0000101' & @CRLF & _
'6/5/2011 10:2:54 - 141 Successful PFRO operations' & @CRLF & @CRLF & _
'6/28/2011 9:21:37 - PFRO Error: \??\C:\ProgramData\Tencent\QQPinyin\Repair\, |delete operation|, 0xc0000101' & @CRLF & _
'6/28/2011 9:21:37 - 141 Successful PFRO operations' & @CRLF & _
'这一行是增加的,测试匹配不仅仅是行尾6/4/2011 9:6:9 - PFRO Error: \??\C:\Users\ADMINI~1\AppData\Local\Temp\VMwareDnD\cde02309\, |delete operation|, 0xc0000101 这里增加了测试'
MsgBox(0, '原字符串', $Str)
;Local $Test = StringRegExp($str, '(?m)^.*?0x[a-fA-F0-9]+', 3);如果要匹配包含所有16进制的行时用这句
;Local $Test = StringRegExp($str, '(?m)^.*?0xc0000101(?=[\r\n])', 3);如果0xc0000101必须在行尾才匹配的话用这句
Local $Test = StringRegExp($str, '(?m)^.*?0xc0000101(?(?![\r\n]).*)', 3);如果0xc0000101在行中间也匹配的话用这句
If Not @Error Then MsgBox(0, '匹配数量: ' & UBound($Test), '其中[0]元素为: ' & $Test[0])
_ArrayDisplay($Test, UBound($Test))
|