#include <array.au3>
$timer = TimerInit()
Dim $array[21] = ['czr1.5', _
'czr1.6abc', _
'opear1000ab', _
'cxd5.9', _
'opear5.6', _
'64.1auto123', _
'4cxd0.25df5', _
'cadll8.613', _
'czr48as26', _
'opear5855as85', _
'45cxd0.25f', _
'auto984', _
'opear354df', _
'czr48', _
'opear5855', _
'45cxd0.25', _
'auto984', _
'opear354', _
'541auto1.3', _
'cadll861', _
'auto984dfa']
Dim $newarray[UBound($array)][2]
Dim $prenumber, $item
For $i = 0 To UBound($array) - 1
$item = $array[$i]
$prenumber = StringRegExp($item,"^-?[\d]+(\.\d+)?",2)
If Not @error Then
$newarray[$i][0] = Number($prenumber[0])
Else
$newarray[$i][0] = $item
EndIf
$newarray[$i][1] = $item
Next
_ArraySort($newarray)
For $i = 0 To UBound($newarray) - 1
$array[$i] = $newarray[$i][1]
Next
_ArrayDisplay($array, TimerDiff($timer)) ;
|