I am trying to match the particular word in a string but it is matching the whole string
doc = "<span>Hi welcome to world</span>"
puts doc.match(/<span>(.*?)<\/span>/)
This code prints the whole string
Output:
<span>Hi welcome to world</span>
But i want only
Hi welcome to world
The another problem is that the output for this program is just an integer
doc = "<span>Hi welcome to world</span>"
puts doc =~ (/<span>(.*?)<\/span>/)
Output:
0