const regex = /http.*zippyshare.*\.html/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('http.*zippyshare.*\\.html', 'gm')
const str = `/b/ - Catalog https://55chan.org/b/catalog.html
Punch! Fansubs https://punchsubs.net/projeto/504/2
Zippyshare.com - PUNCH_Mushishi_-_06_SD.mkv https://www36.zippyshare.com/v/fBA0yWY3/file.html
Zippyshare.com - PUNCH_Mushishi_-_05_SD.mkv https://www26.zippyshare.com/v/9mWT8v7X/file.html
Zippyshare.com - PUNCH_Mushishi_-_04_SD.mkv https://www94.zippyshare.com/v/zLFWM4dC/file.html
Zippyshare.com - PUNCH_Mushishi_-_03_SD.mkv https://www18.zippyshare.com/v/7p1LRySL/file.html
Zippyshare.com - PUNCH_Mushishi_-_02_SD_REV3.mkv https://www95.zippyshare.com/v/nkMUaqNJ/file.html
Zippyshare.com - PUNCH_Mushishi_-_01_SD_REV3.mkv https://www31.zippyshare.com/v/2EkNKEwD/file.html
Cópia de OneClickRun.ipynb - Colaboratory https://colab.research.google.com/drive/1cSKxX5c2R4SLsdcndRoBzXgmZ2Fkd-sR?authuser=3#scrollTo=Mfg4A3KRjESb
Resultados da pesquisa por “Mushishi” – OldAge Subs https://oldagesubs.com/?s=Mushishi&submit=Pesquisar
`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
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}`);
});
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions