Regular Expression: exclude html tags from “content”

前端 未结 3 1767
轻奢々
轻奢々 2020-12-06 22:14

One friend asked me this and as my knowledge on RegExp is not so good yet here I am.

How can exclude the HTML tags from this string?

re
na&l
3条回答
  •  一向
    一向 (楼主)
    2020-12-06 22:16

    this is a quick way to do it:

    var content = "re
    na
    to
    galvao"; content = content.replace(/<[^>]*>/g,'');

提交回复
热议问题