From: kjana@...4lab.to (YANAGAWA Kazuhisa) Date: 2003-03-12T20:22:42+09:00 Subject: Re: scanning strings In message <3e6e4260$0$132$edfadb0f@dtext01.news.tele.dk> mikkelfj-anti-spam@bigfoot.com writes: > > You can use split with a regular expression. Or you can use a > > regular expression with defined subexpressions. Either way you > > can get the results you are looking for. > > Nope, split will not give me the text where the split takes place > and it will also not give me a match object such that I can use > subexpressions. What did you test? >ruby -ve 'p "abc def ghi".split(/(\s+)/)' ruby 1.7.2 (2002-05-07) [i386-freebsd] ["abc", " ", "def", " ", "ghi"] Hmm, by the way, " abc def ghi ".split(/(\s+)/) yields ["", " ", "abc", " ", "def", " ", "ghi", " "] what criteria causes asymmetry of prefixing "" and no trailing that? I forgot the thread on this issue.... -- kjana@dm4lab.to March 12, 2003 Every body's business is nobody's business.