From: 7stud -- Date: 2007-11-14T06:02:26+09:00 Subject: Re: can't modify literal regexp: why? Jeremy Stephens wrote: > 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? (/blah/).clone -- Posted via http://www.ruby-forum.com/.