const regex = new RegExp('<div\\sclass="[^>]*><a\\s[^>]*><span[^>]*>[^>]*></i>[^>]*>[^>]*></i>\\s(.*?)\\s\\([^>]*>[^>]*></a>', 'gmi')
const str = `<div class="list-group font-12"><a class="list-group-item break-word view_file_download at-tip" href="https://kazua.net/bbs/download.php?bo_table=price&wr_id=3504&no=0&page=2"><span class="pull-right hidden-xs text-muted"><i class="fa fa-clock-o"></i> 2018.07.25 02:37</span><i class="fa fa-download"></i> tvN 식샤를 합시다 3 비긴즈.E03.180723.1080p-NEXT.mp4.torrent (209.7K) <span class="orangered">+ 16</span></a>`;
// 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