Method of replacing all tags in HTML text


(? i) Indicates a case mismatch. Both uppercase and lowercase are replaced
html = html.replaceAll(“(<(?i)(|)[^]*/?>)|( )|(‘)|(\”)”, “”);
(<(?i)(|)[^]*/?>)|( )|(‘)|(\”)  — Match all tags with spaces and quotes
If only a part is replaced, make the following modification
(<(?i)(|)[^]*/?>)–Replace all labels
(<(?i)(p|img)[^]*/?>)–Replace P and img Tags
(<(?i)a[^]*/?>)    — Replace a label only