正则表达式从c#中删除html中的特定字符 [英] regex to remove specific characters from html in c#
问题描述
你好团队,我有c#应用程序,我正在寻找我面临的问题的答案
字符串是
hi team, i have c# application and i am looking for answer to the issue i face
string is
newdate= "<a href="Temporarydata.aspx?name=Current transaction does not exceed $X of Credit Limit">Current Transaction should be Within $X of Credit Limit</a>"
这里我试图用不同的正则表达式从上面的文本中删除$ X
i尝试使用regex
here i am trying to remove $X from above text with different regex expressions
i tried the following options with regex
newdate = Regex.Replace(newdate, "<(.|\n)*?>", string.Empty);
newdate = Regex.Replace(newdate, @", string.Empty);
以上正则表达式我得到的文字是
当前交易应该在X内信用限额
可以指导我选择获取文字的选项
当前交易应在信用限额的X美元范围内
谢谢
with above regex expressions i am getting the text as
"Current Transaction should be Within X of Credit Limit"
can some one guide me on the the option to get the text like
"Current Transaction should be Within $X of Credit Limit"
Thanks
推荐答案
信用限额的X >当前交易应在
X of Credit Limit">Current Transaction should be Within
中
X信用限额< / a>
X of Credit Limit</a>"
这里我想删除
here i am trying to remove
上面带有不同正则表达式的文本中的X
i尝试使用正则表达式的以下选项
X from above text with different regex expressions
i tried the following options with regex
newdate = Regex.Replace(newdate, "<(.|\n)*?>", string.Empty);
newdate = Regex.Replace(newdate, @", string.Empty);
以上正则表达式我得到的文字是
当前交易应该在X内信用限额
可以指导我选择获取文字的选项
当前交易应在
with above regex expressions i am getting the text as
"Current Transaction should be Within X of Credit Limit"
can some one guide me on the the option to get the text like
"Current Transaction should be Within
中
这篇关于正则表达式从c#中删除html中的特定字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!