Cleaning regex of styles in the HTML code

I am trying to delete the attributes (style, class, id, name) from HTML tags. To find them I use a regex and then replace them.
I have the intention of deleting them from the whole code, but I do not know why I’m left behind.
From the beginning I thought it was because of the match flags, but I added multiline and anyway remain.
Here is the code of my regex

maybe I do not use the match flags correctly?

Pattern regexPat = Pattern.compile(‘<((?=(td))[^>]|(?=(span))[^>]|(?=(strong))[^>]|(?=(div))[^>]|(?=(p))[^>]|(?=(ul))[^>]|(?=(li))[^>])’,1)
Matcher mat = regexPat.matcher(d)
while (mat.find()) {

		String result =
	 d=d.replaceAll(result,"BBBBBBBBBBB" /* + + + + + + +*/)		   

I hope you understand what I’m thinking :frowning: