I am trying to extract a ur link from a data item using below regex function but getting error "match not found'.
Content: <a href="https:// ... ">
Regex Function:
export function GetImage2(content) {
myRegexp = new RegExp(/<a.*?href="(.*?)"/);
match = myRegexp.exec(content);
if (match) {
// match[1] = match[1].split(/\s+/);
// match[1] = match[1].join(" \' ");
// console.log('Matches found:' + ' ' + match[1]);
return match[1];
}
console.log('No match found');
}
I am at wits end on this. Thanks as you assist.