我有一个html页面,其中包含以下主重置css。我将获取html代码作为java中的字符串,我必须使用java从css代码中删除/替换/注释。我必须在删除/替换下面的CSS时排除其他内联css样式。我尝试使用StringUtils类,但它不起作用。我怎么能在java中做到这一点?
<style type="text/css">
@charset "utf-8";
/* CSS Document */
/* Ver 1.0 Author*/
/* master reset */
a,abbr,acronym,address,applet,b,big,blockquote,body,button,caption,center,cite,code,dd,del,dfn,
dir,div,dl,dt,em,embed,fieldset,font,form,frame,h1,h2,h3,h4,h5,h6,hr,html,i,iframe,img,input,
ins,kbd,label,legend,li,menu,object,ol,option,p,pre,q,s,samp,select,small,span,strike,strong,
sub,sup,table,tbody,td,textarea,tfoot,th,thead,tr,tt,u,ul,var
{background:transparent;border:0;font-family:inherit;font-size:100%;font-style:inherit;
font-weight:inherit;margin:0;outline:0;padding:0;vertical-align:baseline;}
html {font-size:1em;overflow-y:scroll;}
body {background:white;color:black;line-height:1;}
a,ins {text-decoration:none;}
blockquote,q{quotes:none;quotes:"" "";}
blockquote:before,blockquote:after,q:before,q:after {content:"";content:none;}
caption,center,td,th {text-align:left;}
del {text-decoration:line-through;}
dir,menu,ol,ul {list-style:none;}
table {border-collapse:collapse;border-spacing:0;}
textarea {overflow-y:auto;}
</style>