判断一个字符串是否包含连续数字
[color=red]String reg = "^.*\\d{15}.*$";
String text = "{\"words\":\"注册号460106600543629\"";
if(text.matches(reg)&&text.contains("注册号")){
System.out.println("包含15位连续数字,并且包含注册号");
}[/color]
[color=red]String reg = "^.*\\d{15}.*$";
String text = "{\"words\":\"注册号460106600543629\"";
if(text.matches(reg)&&text.contains("注册号")){
System.out.println("包含15位连续数字,并且包含注册号");
}[/color]