有人跟帖后就请不要修改原问题。否则跟帖都会无效成垃圾。有新问题应该跟帖提问。#include <Array.au3>
Local $sSource = _
'e:\file' & @CRLF & @CRLF & _
' DACL(not_protected):' & @CRLF & _
' Administrators full allow container_inherit+object_inherit' & @CRLF & _
' SYSTEM full allow container_inherit+object_inherit' & @CRLF & _
' Administrators full allow no_inheritance' & @CRLF & _
' CREATOR OWNER full allow container_inherit+object_inherit+inherit_only' & @CRLF & _
' Users read_execute allow container_inherit+object_inherit' & @CRLF & _
' Users FILE_ADD_SUBDIRECTORY allow container_inherit' & @CRLF & _
' Users FILE_ADD_FILE allow container_inherit' & @CRLF & @CRLF & @CRLF & _
'SetACL finished successfully.'
;~MsgBox(0, '源字符串', $sSource)
Local $aSRE = StringRegExp($sSource, '(?m)^\h*([\S\h]+)\h+(\S+)\h+(\S+)\h+(\S+)', 3)
If @Error Then Exit
Local $i, $a2D4[UBound($aSRE) / 4][4], $ix = 0
For $i = 0 To UBound($aSRE) - 4 Step 4
$a2D4[$ix][0] = $aSRE[$i]
$a2D4[$ix][1] = $aSRE[$i + 1]
$a2D4[$ix][2] = $aSRE[$i + 2]
$a2D4[$ix][3] = $aSRE[$i + 3]
$ix += 1
Next
_ArrayDisplay($a2D4, UBound($a2D4))
|