private String filterAttributes ( String html ) { String filteredHtml = html ; for ( String attribute : this . filterAttributes ) { String regex = "\\s" + attribute + "=\"[^\"]*\"" ; Pattern p = Pattern . compile ( regex , Pattern . CASE_INSENSITIVE ) ; Matcher m = p . matcher ( html ) ; filteredHtml = m . replaceAll ( "" ) ; } return filteredHtml ; }
Filters attributes from the HTML string .