I am matching a pattern and i need to split and push it into an array.
a = Array.new
doc = "<span>Hi welcome to world</span>"
len = doc.length
puts doc.scan(/o/)
a << doc.scan(/o/)
puts a.length
Output for the above code is
o
o
o
1
The length of array is 1
I want the length of array to be 3
Instead of pushing a complete string into an array. i want to push it as three different elements
ahas a second element which is the array produced fromdoc.scan(/o/).