较规则命名方式的较智能方式提取有效排序数字#include <Array.au3>
Local $Str = _
'1998.aclo05.720p.mkv' & @CRLF & _
'2004.bhjh20.1080p.mkv' & @CRLF & _
'2004.cdfx02.720p.mkv' & @CRLF & _
'2004.ffin07.720p.mkv' & @CRLF & _
'2003.fwvs13.720p.mkv' & @CRLF & _
'2004.gxwn10.480p.mkv' & @CRLF & _
'2004.hszh14.1080p.mkv' & @CRLF & _
'2004.iolc08.720p.mkv' & @CRLF & _
'2004.jfwz15.720p.mkv' & @CRLF & _
'2002.jxli24.720p.mkv' & @CRLF & _
'2004.kazu04.720p.mkv' & @CRLF & _
'2004.kyrz03.1080p.mkv' & @CRLF & _
'2004.lpbr12.720p.mkv' & @CRLF & _
'2004.oujg19.720p.mkv' & @CRLF & _
'2002.ppmz17.720p.mkv' & @CRLF & _
'2004.qcfp09.720p.mkv' & @CRLF & _
'2004.qwqm16.480p.mkv' & @CRLF & _
'2004.rcvj25.720p.mkv' & @CRLF & _
'2010.rrnd21.720p.mkv' & @CRLF & _
'2012.scsf23.720p.mkv' & @CRLF & _
'2004.usvm06.720p.mkv' & @CRLF & _
'2009.wwhv01.720p.mkv' & @CRLF & _
'2008.xbgt18.720p.mkv' & @CRLF & _
'2004.xzlv22.720p.mkv' & @CRLF & _
'2004.youh11.720p.mkv'
Local $aSR0 = StringRegExp($Str, '\V+', 3)
If @error Then Exit
Local $aOK, $sBdsQ = '', $SL = UBound($aSR0)
While 1
$sBds = $sBdsQ & '(\d+).*'
Local $aSR1 = StringRegExp($Str, $sBds, 3) ;(.*?(\d+).*)
If @error Or UBound($aSR1) <> $SL Then ExitLoop
If _ArrayMax($aSR1) - _ArrayMin($aSR1) <> $SL - 1 Then
$sBdsQ &= '\d+\D+'
Else
Dim $aOK[UBound($aSR1)][2]
For $i = 0 To UBound($aSR1) - 1
$aOK[$i][0] = $aSR0[$i]
$aOK[$i][1] = $aSR1[$i]
Next
_ArrayDisplay($aOK, 'ok')
ExitLoop
EndIf
WEnd
|