From: Makoto.Nakagawa@... (=?ISO-2022-JP?B?GyRCQ2ZAbhsoQiAbJEJAPxsoQg==?=) Date: 2009-07-01T18:08:51+09:00 Subject: Re: regular expression gurus--help! --pgp-sign-Multipart_Wed_Jul__1_18:03:07_2009-1 Content-Type: text/plain; charset=ISO-2022-JP In message "Re: regular expression gurus--help!" on 09/06/21, Sebastian Hungerecker wrote: >>> "abcdefghijkl".scan(/(.)(?=(..))/).map(&:join) > => ["abc", "bcd", "cde", "def", "efg", "fgh", "ghi", "hij", "ijk", "jkl"] I find this really interesting, but what version of Ruby is this? I am not able to reproduce your result. $ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] $ ruby1.9 -e 'p "abcdefghijkl".scan(/(.)((?=..))/).map(&:join)' ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] $ ruby1.9 -v ruby 1.9.0 (2008-06-20 revision 17482) [i486-linux] $ ruby1.9 -e 'p "abcdefghijkl".scan(/(.)((?=..))/).map(&:join)' ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] Or is this a feature of 1.9.1? -- /*** Hewlett-Packard Japan, Ltd. ***/ /*** EDS Application Services ***/ /*** Consumer Industries & Retail, Department #4 ***/ /*** Nakagawa, Makoto(中川 誠) 050 3158 4747 (Dial-In) ***/ /*** PGP: 0B33 EAC3 F2F6 3D10 D9E9 AE7F 8EDA 44F9 1D29 D44A ***/ --pgp-sign-Multipart_Wed_Jul__1_18:03:07_2009-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQCVAwUASksmTwdij9ktsB7pAQJ1pAP/VJ5q8yhSw2bJ8uaLyneQs5QYcoEnFbW+ 9fR1Qv41ttIzbIvRIYEXykXP3NAARYEHh/huvjhi3if89VuLgMmWOzbZRKXRyS40 48a83ZalyY23YlMU9P7vr0wCUuKeGitO8yYxEToIJ91T8St/UZRsSdE71XrgD38F q9yiRc/5Zeg= =6PFc -----END PGP SIGNATURE----- --pgp-sign-Multipart_Wed_Jul__1_18:03:07_2009-1--