using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public static void Test()
var jtokenRoot = JToken.Parse(GetJson());
.SelectTokens("store.book[?(@.authors[?(@.lastName =~ /^(?i)[\\s]*waugh[\\s]*$/)])].title")
Console.WriteLine(JsonConvert.SerializeObject(titles, Formatting.Indented));
static string GetJson() =>
"title": "Sayings of the Century",
"title": "Sword of Honour",
"lastName": "WaughTolkien"
"title": "The Lord of the Rings",
public static void Main()
Console.WriteLine("Environment version: {0} ({1}), {2}", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , Environment.Version, Environment.OSVersion);
Console.WriteLine("{0} version: {1}", typeof(JsonSerializer).Namespace, typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");