How can I get a string inside double quotes using regular expression?
I have the following string:
<img src="http://yahoo.com/img1.jpg" alt="">
I want to get the string http://yahoo.com/img1.jpg alt="" outside.
How can I do this using regular expression?
I don’t know why you want the alt tag as well, but this regexp does what you want:
Group 1 is the url and group 2 is the alt tag. I would possibly modify the regexp a bit if there can be several spaces between img and src, and if there can be spaces around ‘=’
Output: