编程知识 cdmana.com

Java regular -- Chinese is not allowed, only numbers + letters + some special symbols are allowed

Java Regular —— Chinese is not allowed , Only numbers... Are allowed + Letter + Some special symbols

Specific cases

The rules : Allowed number 、 Upper and lower case letters and .,-_()/=+?!*;@ # :% []‘${}^|~\n\r\t Equal special character

        Pattern p= Pattern.compile("[a-zA-Z0-9_.,\\-()/=+?!*;@#:%\\[\\]‘\\\\${}^|~\\n\\r\\t ]{1,35}");

        String str = ".,\\-()/=+?!*[\\]‘\\ 0.0${}^|~\n\r\t";
        Matcher m = p.matcher(str);
        System.out.println(m.matches());

Take this rule for example , Others change their own rules !

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[The blank of writing memory]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224104023979c.html

Scroll to Top