This regular expression collects in the network, but that website even copies all need to register the member, despises it, therefore does not mention him. Also, the original author could not be the site.
The HTML tag has
In fact, the regular expression matching HTML tags is very short, as follows:
<[^>]+>
That's it, it's gone? Yes. Are you surprised?
Although I can't write my writing, I can read this regular expression. First of all, the HTML tag must start with the < symbol, end with a > sign (whether it's self-closing), just a little tangled in the middle, there may be characters, numbers, quotes, line breaks--but there's no way, because the HTML tag ends because it's there, so the middle of the regular expression is [ ^>]+, which means " any more than 1 characters except the > symbol ."
Test in notepad++, using the above regular expression, to successfully replace all HTML tags. Hey, it's very useful.
This article from: http://jo2.org/javascript%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%EF%BC%9A%E5%8C%B9%E9%85%8D%E6%89% 80%e6%9c%89html%e6%a0%87%e7%ad%be/
JavaScript Regular expression: matches all HTML tags