From: Magnus Holm Date: 2013-02-19T23:03:00+09:00 Subject: [ruby-core:52527] Re: [ruby-trunk - Feature #7883][Open] Add Regex#to_proc > class Regexp > def to_proc; lambda {|s| self =~ s} end > end A more general case: class Object def to_proc lambda { |other| self === other } end end (Not that I think this is going to be accepted���)