String regex = "[1-9][0-9]{,14}"; String qq = 123456789; Boolean flag = qq.matches(regex); //告知此字符串是否匹配给定的正则表达式