去除开头或者结尾的特殊符号
String value
= "..?$测试,。";
value
.replaceAll("^[\\pP\\pS\\pZ]+|[\\pP\\pS\\pZ]+$","")
就去除结尾右括号、双引号以外的特殊符号
String value
= "..?$测试,。)\"";
value
.replaceAll("[\\pP\\pS\\pZ && [^)"]]+$
",""
)
\pP\pS\pZ参考:https://blog.csdn.net/u012307002/article/details/51298809
转载请注明原文地址:https://tech.qufami.com/read-12965.html