From: Gary C40 Date: 2007-12-16T00:16:53+09:00 Subject: Splitting string into array keeping delimiters Hi, I've been playing Ruby for a few months now. Yesterday I came across an interesting problem. If I have this string: abcd1234abc123 Now I want to separate the digit group with the non-digit group into an array like this ["abcd",1234,"abc",123]. It's like re.split in Python. How can I do it in Ruby with the least lines of code possible? 'abcd1234abc123'.split(/\d+/) only returns ["abcd","abc"] Thank you in advance -- Posted via http://www.ruby-forum.com/.