Version of filter that uses a flag instead of !p(_)