正则表达式(1) : 判断字符串是否仅包含字母、数字、-、_

        String s = "--____sdfjZ454Z----Zl0sd---fa5453___DFD_----";
        String r = "^[a-z0-9A-Z\\-_]+$";
        System.err.println(s.matches(r));

参考(汉字) : https://blog.csdn.net/dongfengkuayue/article/details/50454477

猜你喜欢

转载自blog.csdn.net/Lxinccode/article/details/82775049
今日推荐