要求用户名由字母、数字、_所组成,且范围在6-15位

public class Isnum {
    public static void main(String[] args) throws Exception {
        String num = "hello";
        String regex = "\\w{6,15}";
        System.out.println(num.matches(regex));
    }
}

posted @ 2018-01-09 22:49  fanren224  阅读(1391)  评论(0编辑  收藏  举报