欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

正则表达式匹配不包含某些字符串 不包括 有大用 有大大用 有大大大用

正则表达式匹配不包含某些字符串

  正则表达式匹配不包含某些字符串:

  ^((?!@).)*$   //如果包含@字符串会被匹配处理

public static void main(String[] args){
        String reg = "^((?!@).)*$";
        System.out.println("gdfgfgdffgn".matches(reg));
    }

  字符串不包含@,返回true


来自  https://www.cnblogs.com/senlinyang/p/8651884.html

普通分类: