On Sat, Mar 31, 2007 at 04:31:56AM +0900, Stephen Smith wrote: > So I've cleaned up the regular expression, and I like the simplicity of the > upack message. > > But I think that the format Harry and Gary suggested clearly represents the > pattern I'm matching. > > Since the pattern may change, and/or we may get other data dumps from this > supplier in the future, I think keeping it represented clearly in one place > will help with maintenance. Which could be a constant at the top of the source: LINE_PATTERN = /^(...)(..)(....)/ Then later on in your code you can say: record << LINE_PATTERN.match(line).captures.join(',') << "\n" Regards, Brian.