From: Dave Lee Date: 2004-01-31T06:41:04+09:00 Subject: Re: principle of most suprise tony summerfelt wrote: > gah, ruby is doing it to me again: > > logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x") > tda=Array[(logline.split(/\[\d+\]/))] > tda.first another way of writing this code, which you may find more explicit if you only use tda.first is to use MatchData#pre_match logline = "+ 30 Jan 12:20:09 [3988] addr: x.x.x.x" marker = /\[\d+\]/ marker.match(logline).pre_match # equivalent to tda.first from above Dave