我有一个字符串 str="<u>rag</u>"
.现在,我想获取字符串 "rag"
只要。如何使用正则表达式获取它?
我的代码在这里..
我得到了输出=""
提前致谢..
C#代码:
string input="<u>ragu</u>";
string regex = "(\\<.*\\>)";
string output = Regex.Replace(input, regex, "");
最佳答案
const string HTML_TAG_PATTERN = "<.*?>";
Regex.Replace (str, HTML_TAG_PATTERN, string.Empty);
关于c# - 如何在 C# 中使用正则表达式删除 < 和 > 之间的字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15925498/