From: Dave Rose Date: 2007-01-20T06:19:39+09:00 Subject: Regexp.newbie? i've got a whole file to scan...but can't get neatly get the last occurance with... .scan(/(^A.*?)^A/m){|a| stops<<$1} ...yes i know that last occurance is not scanned because it is succeeded with ^Z line....that's the complication.... A...... M..... d.... A.... r.... f.... A.... .... etc to the last A group.... A..... c.... t.... Z..... note each ^A group can end only with a new occurance of another A record or the Z record.which is the last record of the file....So? how do make a more eligant Reg expression to cover this situation? -- Posted via http://www.ruby-forum.com/.