I have the following regex which is working ok in https://regex101.com/ and so I want to use it in C# but I get the error Unrecognized escape sequence \_
.
^https:\/\/github\.com\/([a-zA-Z\-0-9]+)\/([a-zA-Z\-\_]+)\/commit\/([a-fA-F0-9]{40}),(.*),([0-9]+),([0-9]+)$
in C# I do that:
string regex = @"^https:\/\/github\.com\/([a-zA-Z\-0-9]+)\/([a-zA-Z\-\_]+)\/commit\/([a-fA-F0-9]{40}),(.*),([0-9]+),([0-9]+)$";
and then want to do:
if (Regex.IsMatch(input, regex)) and so on. the error is here on that line.
I cant understand why I get the error in case I use @