非法字符的正则表达式

时间:2025-02-15 16:43:00

public final static String SEARCHKEYREGEX = "[~!/@#$%^&*()\\-_=+\\|[{}];:\'\",<.>/?]+";

//!@~#¥%……&*()——+{}|:“《》?-=【】、;‘,。、

 

public static void main(String []a )
    {
        Matcher m = null;
        String searchKey = "1!";
        if((searchKey))
        {
            (SEARCHKEYREGEX);
            Pattern p = (SEARCHKEYREGEX);    
            m = (searchKey);
            (());
        }
       
    }