Brian Adkins wrote: > On Oct 27, 7:10 pm, Junkone <junko... / gmail.com> wrote: >> Hello >> I have a date like 20070801 in a string. how do i change it to >> 2007/08/01 using regex >> thanks > > Just out of curiosity, why do you want to use regular expressions to > solve this? Don't you just want to insert two '/' characters in the > appropriate place? > > "20070801".insert(4,'/').insert(7,'/') > Ack. I forgot to time that one....and we have a winner. Nice. -- Posted via http://www.ruby-forum.com/.