Posts

Showing posts from November, 2016

regular expression remove font-size

recent I made regular expression for removing font-size tag in style attribute

this is what I made

privatestatic String removeFontSizeFromStyle(String styleContent) { String fontPattern = "[fF][oO][nN][tT]-[sS][iI][zZ][eE]\\s*:\\s*[0-9.]+[a-zA-Z%]*\\s*+;?"; return styleContent.replaceAll(fontPattern, ""); }