improve flexibility of publish_events matcher