const regex = /(conf\_ant|PV00476|PV00011|PV00501|PV00511|PV00521|PV00496|PV00016|PV00491|PV00516|PV00015|PV00018|PV00506|PV00486|PV00014|PV00481|PV00013|PV00502|PV00494|PV00485|PV00495|PV00019|PV00505|PV00500|PV00504|PV00020|PV00012|PV00479|PV00477|PV00522|PV00520|PV00514|PV00499|PV00510|PV00507|PV00492|PV00475|PV00487|PV00017|PV00512)\.html/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(conf\\_ant|PV00476|PV00011|PV00501|PV00511|PV00521|PV00496|PV00016|PV00491|PV00516|PV00015|PV00018|PV00506|PV00486|PV00014|PV00481|PV00013|PV00502|PV00494|PV00485|PV00495|PV00019|PV00505|PV00500|PV00504|PV00020|PV00012|PV00479|PV00477|PV00522|PV00520|PV00514|PV00499|PV00510|PV00507|PV00492|PV00475|PV00487|PV00017|PV00512)\\.html', 'gm')
const str = ``;
// 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