Why no Regexp#to_regexp?

Given:

p RUBY_VERSION    # => "2.1.1"

Then:

p [].to_ary       # => []
p ''.to_str       # => ""

But not:

p //.to_regexp    # undefined method `to_regexp`...

Why is there no Regexp#to_regexp?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs