From: Brian Candler Date: 2003-06-01T05:35:31+09:00 Subject: Re: expandtabs When expanding a tab I guess you are actually interested in the number of characters since the previous tab or newline, so how about something like: def expand_tabs(data, indent=8) data.gsub(/([^\t\n]*)\t/) { $1 + " " * (indent - ($1.size % indent)) } end Anybody have a test suite? Regards, Brian.