string json = "{ "Name": "Tom" }";
var regex = new Regex(@"\\x([a-fA-F0-9]{2})");
json = regex.Replace(json, match => char.ConvertFromUtf32(Int32.Parse(match.Groups[1].Value, System.Globalization.NumberStyles.HexNumber)));
The variable "match" is not defined in my code. The code executes without problem but I'd like to know why C# does not complain that it is undefined? Right after this code, if I write:
x = 1;
C# will complain that x is not defined. What's going on?