In a C# project, Regex is behaving weirdly for me.
I have this method:
string RegTest()
{
string HTML = "<input type=\"hidden\" name=\"authenticity_token\" value=\"d27956cca6b75db4d8dd502d0569dd246455131c\">";
Regex AuthRegex = new Regex(@"name=""authenticity_token"" value=""([A-Ba-b0-9/-]+)""");
string Auth = AuthRegex.Match(HTML).Value;
return Auth;
}
For a reason I don't understand at all, the Regex doesn't find any match with this pattern. It just returns "".
How can I fix this?
@I don't need to escape it. What is the correct way to escape it in the pattern?