From: Ross Shaw Date: 2001-11-30T17:10:26+09:00 Subject: [ruby-talk:27039] Re: How to match '|' but not '\|' > "Ross Shaw" writes: > > > def test_string_split > > actual = 'Split|me|up\|into|four'.split (/??????/) > > expected = %w[Split me up\|into four] > > assert_equals(expected, actual) > > end > > Simple, just use a zero-width negative look-behind assertion. E.g. > > 'Split|me|up\|into|four'.split(/(? > Oh, wait, Perl has those but Ruby doesn't. I wish Ruby had them. > Yes, this is just what I am looking for. Maybe I will try the latest build and see if it has been put in:) Ross