From: Quintus Date: 2010-12-20T06:55:44+09:00 Subject: Re: Regexp, String, Symbol literals' object_ids Am 19.12.2010 21:07, schrieb Pavel R.: > Regexp literals: > 5.times { p /abcdasdf/.object_id } -> same! > How is this possible? For every time the loop is executed there should a new regexp be created... Have a look at this which seems confusing to me: #ruby -v: ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux] irb(main):001:0> 5.times { p /abcdasdf/.object_id } 8030280 8030280 8030280 8030280 8030280 => 5 irb(main):002:0> p /abcdasdf/.object_id 8049600 => 8049600 irb(main):003:0> p /abcdasdf/.object_id 8063560 => 8063560 irb(main):004:0> The regexp in the loop always stays the same, but if I create some others outside the loop, they get a different object ID? Can anybody shade some light on this? Valete, Marvin