using System.Text.RegularExpressions;
using System.Diagnostics;
public static void Main()
""SourceID"" : ""AAA.A"",
""Name"" : ""KAPITAL YAT. "",
""ListingDate"" : ""20140428"",
""SeqNo"" : ""10000000"",
""Average"" : ""3092,3248"",
""SomeValue"" : ""testValue""
Console.WriteLine("\r\n\r\n");
TestWithJsonConvert(json);
private static void TestWithRegex(string json)
var stopWatch = Stopwatch.StartNew();
var pattern = @"(?<=\"")([^\s,].*?)(?=\"")|null";
var matches = Regex.Matches(json, pattern).OfType<object>().ToList();
var index = matches.FindIndex(x => x.ToString() == "SomeValue");
var val = matches[index + 1].ToString();
Console.WriteLine("Index: " + index + " | Value: " + val);
Console.WriteLine("Elapsed time with regex: " + stopWatch.ElapsedMilliseconds);
private static void TestWithJsonConvert(string json)
var stopWatch = Stopwatch.StartNew();
var obj = JsonConvert.DeserializeObject<Root>(json);
Console.WriteLine("Value: " + obj.SomeValue);
Console.WriteLine("Elapsed time with JsonConvert: " + stopWatch.ElapsedMilliseconds);
public string ID { get; set; }
public string SourceID { get; set; }
public int Source { get; set; }
public string Child { get; set; }
public string Name { get; set; }
public object ChildName { get; set; }
public string ListingDate { get; set; }
public string SeqNo { get; set; }
public string Average { get; set; }
public object SomeValue { get; set; }