Added negated matching.
If id is given a list, only print valid ids.