php有没有验证银行卡号的正则表达式

php验证各个银行卡借记卡的正则表达式 在线急求
2024-11-23 08:51:22
推荐回答(3个)
回答1:

假定银行要求其营业厅的卡号格式为:1010 3576 xxxx xxx开始,每4位号码后有空格 1010 3576是固定的,后8位任意数字,就可以这样定义正规表达式:
with t as
(
select '1010 3576 1234 123' id from dual union all
select '1010 3576 1234123' id from dual union all
select '1010 35761234 123' id from dual union all
select '1010 3576 1x34 123' id from dual union all
select '1010 2576 1234 103' id from dual union all
select '1010 35761234123' id from dual union all
select '1010 3576 0234 123' id from dual
)
select * from t where regexp_like(id,'1010 3576 [[:digit:]]{4} [[:digit:]]{3}');

回答2:

[0-9]{19},

银行卡号是19 个0-9的数字组成

回答3:

网上搜集一大把