mrb: implement resolving index for match in mruby