C#正则表达式不工作

C#正则表达式不工作,c#,regex,C#,Regex,我有以下代码,但无法理解为什么没有返回匹配?我需要做什么改变 string temp = "qqqqqqqq<ahref=\"city.php?city=qqqqqqq"; Regex r = new Regex("<ahref=\"city.php?city="); Match m = r.Match(temp); string temp=“qqqq您没有转义点和问号?元字符 Regex r = new Regex("<ahref=\"city\\.php\\?city="

我有以下代码,但无法理解为什么没有返回匹配?我需要做什么改变

string temp = "qqqqqqqq<ahref=\"city.php?city=qqqqqqq";
Regex r = new Regex("<ahref=\"city.php?city=");
Match m = r.Match(temp);

string temp=“qqqq您没有转义点
和问号
元字符

Regex r = new Regex("<ahref=\"city\\.php\\?city=");

Regex r=new Regex(@VVV我刚刚修复了它-您需要将斜杠加倍。别忘了接受答案