public static void main(String[] args) { String pattern="-?[1-9]\d*|0"; Pattern compile = compile(pattern); Matcher matcher = compile.matcher("-1"); if (matcher.matches()) { System.out.println("true"); }else{ System.out.println("false"); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)