如何写意个正则表达式,判断一个字符(包含数字)连续出现4次或4次以上
[code="java"]
String s="011111a";
Pattern p=Pattern.compile("(\w)\1{3,}");
Matcher m=p.matcher(s);
System.out.println((m.find()?"true "+m.group():"false "));
[/code]
[code="javascript"]
function test(str){
var reg=/(\w)\1{3,}/;
alert(reg.test(str));
}
[/code]