Alternative rollup implementation for the rust branch

This is an alternative implementation of #46.
What exactly is this regexp doing? Is it looking for either 'rollup' or 'batch'? If so, why? What does '?:' do?