From: Phrogz Date: 2007-01-13T01:35:11+09:00 Subject: Re: DRY gsub... benj...@fysh.org wrote: > > a = d.split(/(?:\r\n|[;, ])/) > > > > Hope that helps. > > Out of interest, what does the ?: do in there? I've googled, etc, honest! It says, "Please don't capture the stuff in parentheses here, because that changes what split returns". irb(main):001:0> s = "a b,c" => "a b,c" irb(main):002:0> s.split( /( |,)/ ) => ["a", " ", "b", ",", "c"] irb(main):003:0> s.split( /(?: |,)/ ) => ["a", "b", "c"]