On JavaScript, it can remove all HTML tags in the text with regular expressions like this:
replace(/(<([^>]+)>)/ig, "")
In addition, I would like to keep specific tags.
ex)<h1>Text</h1><input type="text">Text</input><b>Text</b> → <h1>Text</h1>Text<b>Text</b>
I tried this code, but it doesn't work correctly.
replace(/<\/{0,1}!(font|h\d|p|hr|pre|blockquote|ol|ul|...).*?>/ig, "");
Please let me know the best formula.