java正则校验 it

java--正则校验

// boolearn matches(String regex):判断当前字符串是否匹配指定的正则表达式true/false
demo:
	String qq = "12345";
	boolearn flag = qq.matches("[1-9][0-9]{4,14}");  // true  (判断qq是否是5~15位,且首字母不能为零)

原文地址:https://www.cnblogs.com/pupil2021/p/11066488.html