Java使用正则表达式匹配字符串

// 目的:替换掉"["、"]"
String str    = "[123,-123]";
String strNew = str.replaceAll("[\\[|\\]]","");


你可能感兴趣的:(Java使用正则表达式匹配字符串)