Made regex sub-group index configurable