I need to delete a field .xxx from an object at any depth of the tree where another field .myfield matches a regex.
I know how to match a precise content:
walk(if type == "object" and .myfield == "my content" then del(.xxx) else . end)'I know about the regex filter
select(.myfield | test(my regexp))How can I convert that filter to a boolean condition for use in the if clause?