How to remove only html tags in a string?

后端 未结 5 2224
庸人自扰
庸人自扰 2021-01-04 17:49

I have written code for removing HTML tags, but it is also removing a type of strings. I want it to not to remove strings like 2<3 or

5条回答
  •  感动是毒
    2021-01-04 18:06

    Strip_tags function is good solution.

    But if you need regex, use expression below.

    (?:<|<)\/?([a-z]+) *[^\/(?:<|<)]*?(?:>|>)

提交回复
热议问题