Hi, At Wed, 14 Nov 2007 05:56:12 +0900, Jeremy Stephens wrote in [ruby-talk:278872]: > I was just curious as to why this is illegal. > > Example: > $ irb > >> /blah/.clone > SecurityError: can't modify literal regexp > from (irb):1:in `initialize_copy' > from (irb):1:in `clone' > from (irb):1 > >> > > Regexp.new(/blah/).clone is perfectly OK. What's insecure about cloning > a literal regex? It is to prohibit /blah/.initialize_copy(/foobar/). You may know, /blah/.dup works. -- Nobu Nakada