奉献一段找手机靓号的代码#include <File.au3>
Dim $__file
#cs
_FileReadToArray('PhoneNumber.txt', $__file)
;1xxabcdabcd
For $i = 1 To $__file[0]
If _FilterNumbers($__file[$i]) > 1 Then MsgBox(0, _FilterNumbers($__file[$i]), $__file[$i])
Next
#ce
MsgBox(0, '靓号等级', _FilterNumbers('15012121212'))
Func _FilterNumbers($__number)
If StringIsSpace($__number) Then Return SetError(0)
Local $__tempText, $__level
;★★★★★abcdabcd
$__a = StringRegExp($__number, '\d{3}(\d{4})', 3)
$__b = StringRegExp($__number, '\d{7}(\d{4})', 3)
If $__a[0] == $__b[0] Then $__level += 3
$__UniqueNumber=StringRegExpReplace(stringMid($__number, 4),'(\d)(?=(?:.*?\1))','')
If StringLen($__UniqueNumber) <= 2 Then $__level += 5 ;纯AB
If StringLen($__UniqueNumber) <= 3 Then $__level += 2 ;纯ABC
If StringRegExp($__number, '(\d\d)\1') Then $__level += 1;ABAB
If StringRegExp($__number, '(\d)\1(\d)\2') Then $__level += 1;AABB
If StringRegExp($__number, '(\w)\1(?!\1)(\w)\2(?!\1|\2)(\w)\3') Then $__level += 2;AABBCC
If StringRegExp($__number, '^\d*(\d)\1\1(\d)\2\2\d*) Then $__level += 2;AAABBB
If StringRegExp($__number, '^(\d)(\d)\1\2\1\2\1\2) Then $__level += 2;ABABAB
If StringRegExp($__number, '^(\d)(\d)(\d)\1\2\3) Then $__level += 2;ABCABC
If StringRegExp($__number, '^(\d)(\d)\2\1\2\2) Then $__level += 2;ABBABB
If StringRegExp($__number, '^(\d)\1(\d)\1\1\2) Then $__level += 2;AABAAB
If StringRegExp($__number, '^\d*(\d)\1{4,}\d*) Then $__level += 2;5-8重复
Return $__level
EndFunc ;==>_FilterNumbers
|