const regex = /^(?:[[:^print:][:cntrl:]\s]|GIF89.{0,20})*<\?(?:php)?\s*[[:punct:]\s]+scama\s*spotify\s*v1[\s\#]+facebook:\s*fb\.com\/amyr\.gov\.tn+[[:punct:]\s]+.{0,200}?want\s*to\s*save\s*rzlt\s*.html(?:[^>]+>\s*)?$/gis;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('^(?:[[:^print:][:cntrl:]\\s]|GIF89.{0,20})*<\\?(?:php)?\\s*[[:punct:]\\s]+scama\\s*spotify\\s*v1[\\s\\#]+facebook:\\s*fb\\.com\\\/amyr\\.gov\\.tn+[[:punct:]\\s]+.{0,200}?want\\s*to\\s*save\\s*rzlt\\s*.html(?:[^>]+>\\s*)?$', 'gis')
const str = `<?php
/*
\$\$\$\$\$\$\\ \$\$\$\$\$\$\$\\ \$\$\$\$\$\$\\ \$\$\\ \$\$\\ \$\$\$\$\$\$\$\$\\ \$\$\\ \$\$\\
\$\$ __\$\$\\ \$\$ __\$\$\\ \$\$ __\$\$\\ \$\$\$\\ \$\$ | \\__\$\$ __|\$\$\$\\ \$\$ |
\$\$ / \$\$ |\$\$ | \$\$ |\$\$ / \$\$ |\$\$\$\$\\ \$\$ | \$\$ | \$\$\$\$\\ \$\$ |
\$\$\$\$\$\$\$\$ |\$\$\$\$\$\$\$ |\$\$ | \$\$ |\$\$ \$\$\\\$\$ |\$\$\$\$\$\$\\ \$\$ | \$\$ \$\$\\\$\$ |
\$\$ __\$\$ |\$\$ __\$\$< \$\$ | \$\$ |\$\$ \\\$\$\$\$ |\\______|\$\$ | \$\$ \\\$\$\$\$ |
\$\$ | \$\$ |\$\$ | \$\$ |\$\$ | \$\$ |\$\$ |\\\$\$\$ | \$\$ | \$\$ |\\\$\$\$ |
\$\$ | \$\$ |\$\$ | \$\$ | \$\$\$\$\$\$ |\$\$ | \\\$\$ | \$\$ | \$\$ | \\\$\$ |
\\__| \\__|\\__| \\__| \\______/ \\__| \\__| \\__| \\__| \\__|
#==========================================#
# Scama Spotify v1 #
# facebook: fb.com/amyr.gov.tn #
#==========================================#
\$\$\$\$\$\$\\ \$\$\$\$\$\$\\ \$\$\\ \$\$\$\$\$\$\\
\$\$ __\$\$\\ \$\$\$ __\$\$\\ \$\$\$\$ | \$\$ __\$\$\\
\\__/ \$\$ |\$\$\$\$\\ \$\$ |\\_\$\$ | \$\$ / \$\$ |
\$\$\$\$\$\$ |\$\$\\\$\$\\\$\$ | \$\$ | \\\$\$\$\$\$\$\$ |
\$\$ ____/ \$\$ \\\$\$\$\$ | \$\$ | \\____\$\$ |
\$\$ | \$\$ |\\\$\$\$ | \$\$ | \$\$\\ \$\$ |
\$\$\$\$\$\$\$\$\\ \\\$\$\$\$\$\$ /\$\$\$\$\$\$\\\\\$\$\$\$\$\$ |
\\________| \\______/ \\______|\\______/
*/
\$aronxname = "ARON-TN";//<== Your Name
\$aronxmail = "moncompteperso12x0@gmail.com"; //<== Your Email
\$aronxsave = "no";//<== Write "On" if U want To Save RZlt .html !
?>
`;
// 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