我想验证新系列BIN范围5[1-5][0-9]{14}
的主卡。目前我有现有万事达卡系列的正则表达式... {{1}}
答案 0 :(得分:0)
编辑:
使用数字时,这可能会更容易:
Title = "Valid card number or not"
Do
CardNumber = InputBox("Please type your card number ",Title,"222100")
If IsValidcard(CardNumber) = True Then
MsgBox CardNumber & " The Card number is valid !",64,Title
Else
MsgBox CardNumber & " The Card number is not valid !",16,Title
End if
Loop Until CardNumber = ""
'**********************************************************************
Function IsValidCard(Num)
IsValidCard = False
Set regEx = New RegExp
regEx.Pattern = "^\d{6}$"
If regEx.Test(Num) then
x = CDbl(num)
if x >= 222100 AND x <= 272099 Then
IsValidCard = True
Else
'not in range
End If
Else
'not 6 digits
end if
End Function
'**********************************************************************