【发布时间】:2023-02-09 02:19:40
【问题描述】:
我有一个像这样的字符串:
String balise1 = "<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=Windows-1252 other balises ... ">";
String balise2 = "<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=UTF-8 other balises ... ">";
String balise3 = "<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=ISO 8859-1 other balises ... ">";
我想删除不是的字符集部分
我如何使用 replace、ReplaceAll 或 Regex 执行此操作
问候
我尝试用 Regex 替换所有但没有成功
【问题讨论】:
-
请edit 并提供有效的 java,您应该在字符串周围加上引号。还分享你尝试的代码
-
这个“3D”的东西是什么?不应该在那里
-
我尝试用 Regex 替换所有但没有成功请分享您的尝试并解释什么不起作用以及原因。