In message "Re: regular expression gurus--help!"
>>> "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?
···
on 09/06/21, Sebastian Hungerecker <sepp2k@googlemail.com> wrote:
--
/*** 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 ***/