Using global variables for match data is not threadsafe; this would be safer if it was like this:

```ruby
if result and (match = result.match /instance-(.*)/)
  match[1]
end
```