(?i) means no matching case. Regardless of uppercase or lowercase, replace
html = html.replaceAll("(<(?i)(|)[^]*/?>)|( )|(') |(")", "");
System.out.println(html);
(<(?i)(|)[^]*/? >)|( )|(')|(") -- Match all tags with spaces and quotation marks
If you only replace part of it, make the following modifications
(<(? i)(|)[^]*/?>) --Replace all tags
(<(?i)(p|img)[^]*/?>) --Replace p and img tags
(<(?i)a[^]*/?>) --Replace only a tag