Sam Duncan wrote in post #1078251:
> On 10/02/2012 10:32 AM, ajay paswan wrote:
>> How to sparse a string like:
>>
>> suppose input is str="<a>1</a><a>22</a><a>3</a>"
>> I want str_a=["<a>1</a>","<a>22</a>","<a>3</a>"]
>> How can I get str_a from str?
>>
> 1.9.3p125 :002 > str.scan /<a>\d+<\/a>/
>   => ["<a>1</a>", "<a>22</a>", "<a>3</a>"]
>
> Sam

What if: str="<a>kl1</a><a>22ik</a><a>3o</a>" ?

-- 
Posted via http://www.ruby-forum.com/.