On May 14, 2009, at 9:28 AM, shawn bright wrote:

> Hey all

Hello.

> I need to be able to split a string into lumps of numbers and letters.
> so for example if st = "JJ542JQ83" would become ['JJ',  
> '542','JQ',"83"]
>
> i have been using st.split(/([a-zA-Z]+)(?=[0-9])/) , this does  
> pretty well
> most of the time,
> but also fails sometimes to do what i need it to . ( like for 202GP)

I suggest:

   str.scan(/\d+|[a-zA-Z]+/)

Hope that helps.

James Edward Gray II