Problems encountered in regularization during development

1. Place the dash in the first position
eg: “阿斯顿-打”.matches("[-\u3E00-\u9FA5]+");
2. "" match
java:
"\" will be converted to "\\" after input, so it should match \\\\
eg: Input "\" is converted into "\\".matches("[\\\\]+");
jsp:
eg: "" is not converted, directly matches "\\"

Guess you like

Origin blog.csdn.net/weixin_41858523/article/details/112554089