I’m using the following code:
string tile = "a1";
Regex regex= new Regex(@"/([a-z])(\d{1,2})/i");
if (regex.Match(tile).Success) Console.WriteLine("Found a match.");
else Console.WriteLine("No match.");
and the console returns “No match.” The regex itself seems fine to me, but I’m probably missing something simple. Any help would be appreciated.
You’re using some javascript regex delineators. Try:
Then you’ll probably want to use IsMatch():