I think that you're doing a little extra work here.  It seems to me that this would do the same thing:

```
return page.uri.to_s.scan(/af\((\w+)\)/)[0]
```

Documentation on `String#scan` is [here](http://ruby-doc.org/core-1.8.7/String.html#method-i-scan)