I would probably write this something like this:

```
if nums = @regexp.name_table[idx]
  nums.each do |num|
val = self[num]
    if 
      return val
    end
  end
```