From: Lloyd Linklater Date: 2007-09-28T20:09:21+09:00 Subject: Re: Break apart a string by kind of characters Gavin Kistner wrote: > On Sep 27, 9:55 am, Daniel Waite wrote: >> Hi all, I've an interesting problem. Imagine the following string: >> >> 'a1000aa' >> >> I want to break it apart like so: >> >> [ 'a', '1000', 'aa' ] > > irb(main):001:0> s = 'a1000aa' > => "a1000aa" > irb(main):002:0> s.split( /(\d+)/ ) > => ["a", "1000", "aa"] Gavin, how in the WORLD does this bit of black magic work and how did you ever figure it out??? -- Posted via http://www.ruby-forum.com/.