我是靠谱客的博主 醉熏手机,这篇文章主要介绍Python 正则表达式验证信用卡号码,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Rule: Visa 13 or 16 digits, starting with 4 MasterCard 16 digits,starting with 51 through 55 Discover 16 digits,starting with 6011 or 65 American Express 15 digits,starting with 34 or 37 Diners Club 14 digits,starting with 300 through 305,36 or 38 JCB 15 digits,starting with 2131 or 1800, or 16 digits starting with 35 (?x)^(?: (?P<visa>4[0-9]{12}(?:[0-9]{3})?) | (?P<mastercard>5[1-5][0-9]{14}) | (?P<discover>6(?:011|5[0-9]{2})[0-9]{12}) | (?P<amex>3[47][0-9]{13}) | (?P<diners>3(?:0[0-5]|[68][0-9])[0-9]{11}) | (?P<jcb>(?:2131|1800|35[0-9]{3})[0-9]{11}) )$

最后

以上就是醉熏手机最近收集整理的关于Python 正则表达式验证信用卡号码的全部内容,更多相关Python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部