On Feb 5, 2009, at 12:39 AM, shawn bright wrote:

> Hey all,
>
> i am looking for an easy way to split a string into letters and  
> numbers.
> so if i had a string '34JKBY103' i could get ['34', 'JKBY', '103']
>
> I could write up something, but thought that if there was already  
> something
> out there that i hav'nt found, it would probably be cleaner.
> thanks
>
> sk



irb> '34JKBY103'.scan(/\d+|\D+/)
=> ["34", "JKBY", "103"]

that looks like an easy way ;-)

-Rob

Rob Biedenharn		http://agileconsultingllc.com
Rob / AgileConsultingLLC.com