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.
我有这个字符串:
<: 用户 | protocol://user-id/951480451967631360 :>某人<:>某事!
我不确定使用正则表达式是否可以结束 <:><:> 部分并最终得到如下内容:
某人某事某事!
这一切都在 C# 中
最简单的正则表达式是:
查找<[^>]*>并替换为空。
<[^>]*>
在 C# 中:
Regex rgx = new Regex("<[^>]*>"); string result = rgx.Replace(yourString,"");