Cleaning regex of styles in the HTML code

Hello.
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 = mat.group()
	
	   println(result)
	 d=d.replaceAll(result,"BBBBBBBBBBB" /* + mat.group(2) + mat.group(3) + mat.group(4) + mat.group(5) + mat.group(6) + mat.group(7) + mat.group(8)*/)		   
	}

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