I did use the below  :-

"12\^ abc23 44".scan(/\d+/).map(&:to_i) 
# => [12, 23, 44]

Now, I thought, let's try to do this without creating an intermediate array.

Then I saw, String#scan supports block, so I can write 

ar = []
"12\^ abc23 44".scan(/\d+/) { |e| ar << e.to_i }

Then I thought, lets use the *block support* of `#scan` some other way and I 
came up with the below :-

"12\^ abc23 44".enum_for(:scan, /\d+/).with_object([]) { |e, a| a << e.to_i }
# => [12, 23, 44]

It works, but not I am able to understand, if it is creating the intermediate 
array ( as #scan do without block), or block version of #scan is getting 
called.

-- 
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore, 
if you write the code as cleverly as possible, you are, by definition, not 
smart enough to debug it.

--Brian Kernighan