I wanted to get image url "http://www.test.com/image.jpg" out from the string:
"<img align="right" alt="Title " src="http://www.test.com/image.jpg" width="120" /><"
Here is the code that I have:
module MyHelper
def getMymage(allDesc)
allDesc = "<img align="right" alt="Title " src="http://www.test.com/image.jpg" width="120" /><"
allDesc = allDesc.scan(src="(\S+)")
end
end
I got the following error:
syntax error, unexpected tAMPER
allDesc = allDesc.scan(src="(\S+)")
syntax error, unexpected $undefined
allDesc = allDesc.scan(src="(\S+)")
How to fix it?