From: Andrei Caragea Date: 2009-07-08T20:58:57+09:00 Subject: Re: several replacing problems I managed to figure out how to do the hash and get rid of those annoying loops. Everything works fine except one thing: the XLS contains the following: A B TODAY 20090708 TODAY+1 20090709 TODAY+10 20090718 TODAY+19 20090727 TODAY+2 20090710 TODAY+20 20090728 TODAY+24 20090801 TODAY+25 20090802 TODAY+4 20090712 TODAY+5 20090713 TODAY+6 20090714 TODAY+7 20090715 TODAY+8 20090716 TODAY+9 20090717 TODAY-1 20090707 TODAY-10 20090628 TODAY-14 20090624 TODAY-15 20090623 TODAY-19 20090619 TODAY-2 20090706 TODAY-20 20090618 TODAY-28 20090610 TODAY-29 20090609 TODAY-30 20090608 TODAY-9 20090629 TODAY-5 20090703 TODAY-25 20090613 TODAY+11 20090719 TODAY+1Y 20100708 after replacing is done i get the following result: >ruby read_xl.rb 20090708 => +t_todaya+ 20090708 => 20090708+1 => tp1a, 20090718 => tp10a, 20090727 => tp19a, 20090708+2 => tp2a, 20090728 => tp20a, 20090801 => tp24a, 20090708+25 => tp25a, 20090708+4 => tp4a, 20090713 => tp5a, 20090714 => tp6a, 20090715 => tp7a, 20090716 => tp8a, 20090717 => tp9a, 20090719 => tp11a, 20100708 => tp365a, 20090628 => tm10a, 200907074 => tm14a, 200907075 => tm15a, 20090619 => tm19a, 20090708-2 => tm2a, 20090618 => tm20a, 20090610 => tm28a, 20090609 => tm29a, 20090608 => tm30a, 20090629 => tm9a, 20090707 => tm1a, 20090708-5 => tm5a, 20090708-25 => tm25a >Exit code: 0 Can anyone help me with a regex to fix the problem? If there is any other way to fix it i would apreciate the feedback thanks. -- Posted via http://www.ruby-forum.com/.