feature: implement regex match operator for JsonPath queries. Syntax is compatibe with Jayway implementation

This commit is contained in:
andre-n
2018-02-10 16:04:35 +01:00
parent 865b2076c2
commit 1876b1bfdf
5 changed files with 119 additions and 40 deletions
@@ -317,7 +317,7 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
[Test]
public void SinglePropertyAndFilterWithRegex()
{
JPath path = new JPath("Blah[ ?( @.name=~'/hi/i' ) ]");
JPath path = new JPath("Blah[ ?( @.name=~/hi/i ) ]");
Assert.AreEqual(2, path.Filters.Count);
Assert.AreEqual("Blah", ((FieldFilter)path.Filters[0]).Name);
BooleanQueryExpression expressions = (BooleanQueryExpression)((QueryFilter)path.Filters[1]).Expression;