leafiy
5/18/2018 - 6:53 PM

get attr #regex

none

(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?

([^"]+)

var str = '<a href="example.com"></a><a href="example2.com"></a><a href="example3.com"></a>';
var pattern = /href="([^"]+)/g;
var match = pattern.exec(str);
while (match != null) {
    console.log(match[1]);
    match = pattern.exec(str);
}