Need regex to select the negative pattern selection of html tags

做~自己de王妃 提交于 2019-12-13 10:25:34

问题


I need the regex pattern where it finds the text other than the html tags,

(<\s*[^>]*>)

And the text is

This is simple html text <span class='simple'>simple simple text text</span> text

Result should be

This is simple html text simple simple text text text

Please check the below link

https://regex101.com/r/cD8nG4/217


回答1:


In the example you gave, it is much easier to find the HTML tags with the regex you already have, and then replace the found strings with empty strings.

I have done that several times, and it works like a charm.



来源:https://stackoverflow.com/questions/56930710/need-regex-to-select-the-negative-pattern-selection-of-html-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!