一个数字字符串,
要求最后的8为中,前四位,后四位都必须至少有一个数字1
小弟的写法如下,可是不起作用
- SQL code
select count(1) from dual where regexp_like('0000800000','^[[:digit:]]*([[:digit:]*8[:digit:]]*){4}([[:digit:]*8[:digit:]]*){4}$')
------解决方案--------------------
http://www.cnblogs.com/tracy/archive/2010/04/15/1712591.html
------解决方案--------------------
- SQL code
select count(1)from dualwhere regexp_like(substr('1234567890',-8,4),'(\d.*?){1}') and regexp_like(substr('1234567890',-4),'(\d.*?){1}')