Implement RegExp::collect