#include <Array.au3>
Local $Str = _
'Disk Partitions Cylinders Heads Sectors Mbytes Model' & @CRLF & _
' 1 5 30401 255 63 238475.2 ST3250310AS' & @CRLF & @CRLF & _
'Partition Status Type Volume Label Mbytes System Usage' & @CRLF & _
'C: 1 A PRIMARY 10252.4 NTFS/HPFS 4%' & @CRLF & _
' 2 EXTENDED 228220.3 96%' & @CRLF & _
'D: 3 LOGICAL 61451.7 NTFS/HPFS 26%' & @CRLF & _
'E: 4 LOGICAL 81933.0 NTFS/HPFS 34%' & @CRLF & _
'F: 5 LOGICAL 84835.4 NTFS/HPFS 36%'
MsgBox(0, '原字符串', $Str)
Local $Test = StringRegExp($str, '[A-Z]\:.*?(?:%)', 3)
local $array[1][8],$Left,$Right
for $i=0 to UBound($Test)-1
$temp=StringRegExp($Test[$i],'[^\h]+',3)
if UBound($temp)=6 then _ArrayInsert($temp,2,"")
_ArrayInsert($temp,4,"")
ReDim $array[$i+1][8]
for $n=0 to 7
$array[$i][$n]=$temp[$n]
Next
Next
_ArrayDisplay($array)
|