62,616
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String[] args) {
String str = "[[1;32mroot[1;33m@[1;31mT300018663 19:29:26 [1;35m~[0m]#";
str = str.replaceAll("\\x1b\\[[0-9]+(?:;[0-9]+){0,2}m", "");
System.out.println(str);
}
}