Skip to content

Instantly share code, notes, and snippets.

@sanishan
Created April 23, 2018 21:45
Show Gist options
  • Save sanishan/89c6920f8dbebeee06bb7a77b5d80a94 to your computer and use it in GitHub Desktop.
Save sanishan/89c6920f8dbebeee06bb7a77b5d80a94 to your computer and use it in GitHub Desktop.
const regex = /\.profile_view_img_(.*?) { background-image: url\('https:\/\/www\.like4like\.org\/img\/(.*?)'\);/g;
const str = document.body.innerHTML;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment