Closed jorol closed 5 years ago
I think the syntax is
select any_match(foo,bar)
reject any_match(foo,bar)
Don't know why reject works in the other syntax.
Yes, it works as condition, but sometime I want to do something like:
echo '{"foo":"bar"}' | catmandu convert JSON --fix 'if any_match(foo,'^b') if any_match(foo,'r$') select() end end'
It is also mentioned in the docs:
...
# Select all items
select()
...
unless foo() reject() end
works. The inverse is a lot more difficult to implement and would imply some kind of program analysis.
Ok, I will fix the docs. Thanks.
Catmandu::Fix::reject works: