以下方法环境为Java语言
字符串是否包含数字:
"gfdgd1111".matches("[^.]*[\\d]+[^.]*")
炸弹号码666..或888...或999...:
String str = "";
String pattern = "^(6+|8+|9+)$";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(str);
System.out.println(m.matches());
2024-03-04 15:04:35
字符串是否包含数字:
"gfdgd1111".matches("[^.]*[\\d]+[^.]*")
炸弹号码666..或888...或999...:
String str = "";
String pattern = "^(6+|8+|9+)$";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(str);
System.out.println(m.matches());