;~ ### 友情提示:本脚本由 Au3 正则测试工具 于 2022年06月22日17点18分51秒 自动生成,不保证其正确性,请自行修改测试 ###
#include <Array.AU3>
$zfc=''
$string = _
'{"menu_id":1,"menu_name":"流程管理","menu_has_one_flow_module_factory":null,"empower":"is_empower"},{"menu_id":6,"menu_name":"文档中心","menu_has_one_flow_module_factory":null,"empower":"is_empower"},{"menu_id":11,"menu_name":"内部邮件","menu_has_one_flow_module_factory":null,"empower":"is_empower"},{"menu_id":14,"menu_name":"外部邮件","menu_has_one_flow_module_factory":null,"empower":"is_empower"},{"menu_id":26,"menu_name":"日程计划","menu_has_one_flow_module_factory":null,"empower":"no_empower"},{"menu_id":32,"menu_name":"考勤管理","menu_has_one_flow_module_factory":null,"empower":"no_empower"},{"menu_id":434,"menu_name":"假期管理","menu_has_one_flow_module_factory":null,"empower":"no_empower"},{"menu_id":37,"menu_name":"费控管理","menu_has_one_flow_module_factory":null,"empower":"no_empower"},{"menu_id":43,"menu_name":"手机短信","menu_has_one_flow_module_factory":null,"empower":"no_empower"},{"menu_id":44,"menu_name":"客户管理","menu_has_one_flow_module_factory":null,"empower":"no_empower"}'
Local $Array = StringRegExp($string, '(\d+).*?(?<="menu_name":")([^"]+)' ,3)
If IsArray($Array) Then
For $i = 0 To UBound($Array) - 1 Step 2
$zfc &= "'" &$Array[$i]&"=>"& $Array[$i+1]&"',"
ConsoleWrite($zfc)
Next
EndIf
$Array=StringSplit($zfc,',')
_ArrayDisplay($Array,'$zfc')
For $n=1 To $Array[0]-1
For $n1 = $n + 1 To $Array[0]-1
If Number(StringRegExp($Array[$n], '\d+', 1)[0]) > Number(StringRegExp($Array[$n1], '\d+', 1)[0]) Then
$temp = $Array[$n1]
$Array[$n1] = $Array[$n]
$Array[$n] = $temp
EndIf
Next
Next
_ArrayDisplay($Array,'$Array')