Guest User

Untitled

a guest
May 23rd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. (\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?
  2.  
  3. ([^"]+)
  4.  
  5. var str = '<a href="example.com"></a><a href="example2.com"></a><a href="example3.com"></a>';
  6. var pattern = /href="([^"]+)/g;
  7. var match = pattern.exec(str);
  8. while (match != null) {
  9. console.log(match[1]);
  10. match = pattern.exec(str);
  11. }
Add Comment
Please, Sign In to add comment