Can you simplify this a bit, perhaps:

```ruby
regex = Array(regexp).map { |rx| Regexp === rx ? rx.source : rx.to_s }.join(',')
```