正则表达式的颜色十六进制

时间:2016-12-18 18:22:39

标签: java regex

我有这样的String,我想用color:#*****;替换'null',我试图使用所有可能的模式,请帮帮我

String s="<p style='color: rgb(87, 112, 131);'><span style='color:#daa520;'><u>Need alliance match fo</u>r Pune based Gupta Boy <em>27/5'6''. MBA - Runs own </em>business. Girl</span> <span style='color:#00ffff;'>should be well educated</span> <span style='font-size:14pt;'>homely, slim, tall &amp; b/ful. </span>Caste no bar</p>";

1 个答案:

答案 0 :(得分:0)

您需要替换所有:

s = s.replaceAll("color:#[0-9a-fA-F]{6};", "null");