Please, help me with regular expression to grab image source in any
text string using the code below. I only need the regex to be plugged
in:
var strText = "some text <img src='image.jpg'and some text";
var separateBy = ", ";
var result = ""; // if no match, use this
var allMatches = strText.match(........--->reg exp<---........);
if (allMatches) {
result = "";
for (var i = 0; i < allMatches.length; i++) {
if (i != 0) result += separateBy;
result += allMatches[i];
}
}
alert(result)
Result should be: image.jpg
Thanks