fix read option mask and add support for things like [(:capture){3}]