假定银行要求其营业厅的卡号格式为:1010 3576 xxxx xxx开始,每4位号码后有空格 1010 3576是固定的,后8位任意数字,请教这个正则表达式该怎么写?我现在是在oracle里面写约束,大侠帮忙啊。。。。
------解决方案--------------------
'^1010 3576 [0-9]{4} [0-9]{4}$'
------解决方案--------------------
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}');