Filter by Regex in JQ

If you tacked the following filter onto the one you already have, then you’d get the output shown below:

map(select(.Address | test("^[0-9]")))

Output:

[
  {
    "Address": "1 Bridge Rd"
  }
]

For robustness, you might like to consider adding ? after the test:

map(select(.Address | test("^[0-9]")?))

Or, you could combine the two calls to map in various ways. You might like to consider:

.[].payload.address | select(test("^[0-9]")?) | {Address: .}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)