Match 7 items with rar

On my system

app/kod/archiveLib/bin/rar v /path/to/file.rar

Outputs:

UNRAR 5.40 freeware      Copyright (c) 1993-2016 Alexander Roshal

Archive: /path/to/file.rar
Details: RAR 4, volume

 Attributes      Size    Packed Ratio    Date    Time   Checksum  Name
----------- ---------  -------- ----- ---------- -----  --------  ----
 -rw-rw-r-- 12344567  11344567  -->  2019-03-25 02:02  1AA24184  file
----------- ---------  -------- ----- ---------- -----  --------  ----
            12344567  11344567   9%  volume 1                    1

preg_match_all('/\s*([-\.\w]+)\s+(\d+)\s+(\d+)\s+(\d+%|-+>)\s+(\d{2,4}-\d{2}-\d{2} \d{2}:\d{2})\s+\w+\s+(.*)\n/i', $input_lines, $output_array);

matches 7 items:

0	=>	
 -rw-rw-r-- 12344567  11344567  -->  2019-03-25 02:02  1AA24184  file
1	=>	-rw-rw-r--
2	=>	12344567
3	=>	11344567
4	=>	-->
5	=>	2019-03-25 02:02
6	=>	file
pull/351/head
Grant Millar 2019-05-01 18:57:52 +01:00 committed by GitHub
parent db3c392650
commit 409a4eff1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ class kodRarArchive {
$reg = '/\s*([-\.\w]+)\s+(\d+)\s+(\d+)\s+\d+%\s+(\d{2,4}-\d{2}-\d{2} \d{2}:\d{2})\s+\w+\s+(.*)\n/i';
preg_match_all($reg,$match[1]."\n",$matchItem);
if( !is_array($matchItem) ||
count($matchItem) != 6 ||
count($matchItem) != 7 ||
count($matchItem[0]) == 0
){
return array('code'=>false,'data'=>'Match Nothing Item!');