Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从字符串中获取 html 标签。
我试过这个正则表达式:
"<[\r\n ]*/?[\r\n ]*(.*?)[\r\n ]*/?[\r\n ]*>"
但它也给了我:
< / table />
我不想要这样错误的标签。
尝试</?[^>/]*>|<[^>/]*/>或</?[^>/]+>|<[^>/]+/>。谷歌也是你的朋友。
</?[^>/]*>|<[^>/]*/>
</?[^>/]+>|<[^>/]+/>