这里是一个可以动态构建的字符串的例子。
{Static String} <a href="{Dynamic Value}"><b>{Dynamic Value 2}</b></a>
example of static text <a href="http://www.exampleurl.com">example value</a>
如何在 C# 中使用正则表达式查找 {Dynamic Value 2} 或示例值?
最佳答案
stackoverflow 上的人似乎在建议 http://htmlagilitypack.codeplex.com/用于解析 html 并从中提取值。它比使用正则表达式更容错。如果使用正则表达式,如果您搜索的字符串中有任何更改,您将不得不更改正则表达式。
关于c# - 如何使用正则表达式在动态字符串中查找值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12247164/