Reputation: 1749
I need to extract "https://www.domain3.com" from this JSON
{
"jobs": [
{
"name": "alfa",
"url": "https://www.domain1.com"
},
{
"name": "beta_publish",
"url": "https://www.domain2.com"
},
{
"name": "gammma_release",
"url": "https://www.domain3.com"
}
]
}
using a regular expression.
I'm trying to use this one (in https://www.jsonquerytool.com/ ...),
$..jobs[?(@.name=~/release*?/i)].url
but it doesn't work, but if I try to use it in https://regex101.com/ it seems to work fine.
Any suggestion will be appreciated!
Upvotes: 2
Views: 1696
Reputation: 2280
match
instead of =~
JSONPath
$.jobs[?(@.name.match(/release/i))].url
Upvotes: 3