银行卡号 N位数字 perl:$a="1232312312313113123132123";#银行卡号$a=~s/(?<=\d)(?:[\历神明d]{4})$/****/瞎烂gprint "$a\n"python:import rea="1232312312313113123132123";#银行卡号a=re.sub("肢告(?<=\d)(?:[0-9]{4})$","****",a)print a
js:var str = "123456789123456789";var reg 伍明= /(\d*)\d{4}/;str.replace(reg,'腔镇告$1'+'****'旅饥);结果:12345678912345****