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.
我想从下一个字符串中获取内容:
value="/wEPDwULLTE5OTI3MDk2NTMPZBYEAgEPZBYCAgUPFgIeB....>
我怎样才能得到“值=”和“>”之间的所有内容?
谢谢
您可以使用此模式:
value="([^>]*)>
例如:
string input = "value=\"/wEPDwULLTE5OTI3MDk2NTMPZBYEAgEPZBYCAgUPFgIeB....>"; var output = Regex.Match(input, "value=\"([^>]*)>").Value; Console.WriteLine(output); // /wEPDwULLTE5OTI3MDk2NTMPZBYEAgEPZBYCAgUPFgIeB....