如何将我的var userId放到regexp?
string userId = "ololoawd";
string did = Regex.Match(content, @"""dID"":""(.*?)"",""dOF"":true,""dOID"":"" + userId + "",""usS"":").Groups[1].Value;
答案 0 :(得分:0)
string did = Regex.Match(content, @"""dID"":""(.*?)"",""dOF"":true,""dOID"":" + userId + ",""usS"":").Groups[1].Value;
答案 1 :(得分:0)
您没有指定您期望作为输出的内容。我只能看到你在连接userId之前没有正确终止你的第一个字符串。请尝试以下方法:
string userId = "ololoawd";
string did = Regex.Match(content, @"""dID"":""(.*?)"",""dOF"":true,""dOID"":""" + userId + @""",""usS"":").Groups[1].Value;