From: Shannon Fang Date: 2002-12-11T20:38:34+09:00 Subject: String.scan (Regexp again...) Hi gurus, I used the following regexp to parse a text file: p=/.{4}((.{3})(.{6})(.{3})).{17}(.{16}).{13}(.).{33}(.{7}).{17}((.{3})(.{6})(.{3}))/ line="PFPT0YH100010 NUT-SPRG-EXPN 980101G A 00001000010001WA100001050000000 OYH100010 " result=line.match(p) p result >> [["0YH100010 ", "0YH", "100010", " ", "NUT-SPRG-EXPN ", "G", "0000105", " ", " ", " ", " "]] It seems that result is flattened. I expect result like this: [[a,b,c], d,e,f,[g,h,i]] Could anyone tell me how can I achieve that? Thanks a lot! Shannon _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail