From: Simon Strandgaard Date: 2005-10-03T06:13:02+09:00 Subject: Re: split without lookbehind On 10/2/05, Alex Fenton wrote: [snip] > but there's no lookbehind in Ruby - I wonder if someone could suggest a neat > ruby alternative. with oniguruma this works: 'foo/bar // baz/qux'.split(/(? ["foo", "bar // baz", "qux"] I am not sure exactly how you want it splitted. How about this one? 'a/b//c///d////e/////f'.split(/\/(?!\/)/) # => ["a", "b/", "c//", "d///", "e////", "f"] -- Simon Strandgaard