1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
[
/*{
"given" : [
{"name": "hullo world"},
{"name": "hello world"},
{"name": "yes hello world"},
{"name": "HELLO WORLD"},
{"name": "good bye"}
],
"cases" : [
{
"comment" : "Filter expression with regular expression",
"expression" : "$[?(@.name=~/hello.* /)]",
"result" : [
{
"name": "hello world"
},
{
"name": "yes hello world"
}
]
},
{
"comment" : "Filter expression with regular expression",
"expression" : "$[?(@.name=~/hello.* /i)]",
"result" : [
{"name": "hello world"},
{"name": "yes hello world"},
{"name": "HELLO WORLD"}
]
}
]
},
{
"given" : {
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{
"category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{
"category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
},
"cases" : [
{
"comment" : "Filter expression with regular expression",
"expression" : "$.store.book[ ?(@.category =~ /fic.*?/)].author",
"result" : ["Evelyn Waugh","Herman Melville","J. R. R. Tolkien"]
},
{
"comment" : "Filter expression with regular expression",
"expression" : "$.store.book[ ?(@.author =~ /Evelyn.*?/)].author",
"result" : ["Evelyn Waugh"]
},
{
"comment" : "Filter expression with regular expression",
"expression" : "$.store.book[ ?(!(@.author =~ /Evelyn.*?/))].author",
"result" : ["Nigel Rees","Herman Melville","J. R. R. Tolkien"]
}
]
},*/
{
"given" : "The cat sat on the mat",
"cases" : [
{
"comment" : "tokenize",
"expression" : "tokenize($,'\\\\s+')[*]",
"result" : ["The","cat","sat","on","the","mat"]
}
]
}
]
|