From: SpringFlowers AutumnMoon Date: 2007-09-23T23:05:17+09:00 Subject: Re: Questions about Date.strptime SpringFlowers AutumnMoon wrote:> a = "20070923" > > if match = /^(\d{4})(\d{2})(\d{2}$)/.match(a) > a.replace(match[1..3].join("/")) > puts a > end oops, or it can be >> a = "20070923" => "20070923" >> a.sub!(/^(\d{4})(\d{2})(\d{2})$/, '\1/\2/\3') => "2007/09/23" and then use Date.strptime -- Posted via http://www.ruby-forum.com/.