const regex = /<select name="ctl00\$ContentPlaceHolder1\$UrunListesi\$ctrl([0-9]{1,2})\$StokBoyut" id="ctl00_ContentPlaceHolder1_UrunListesi_ctrl([0-9]{1,2})_StokBoyut">([\s\S]*?)<\/select>/gmi;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('<select name="ctl00\\$ContentPlaceHolder1\\$UrunListesi\\$ctrl([0-9]{1,2})\\$StokBoyut" id="ctl00_ContentPlaceHolder1_UrunListesi_ctrl([0-9]{1,2})_StokBoyut">([\\s\\S]*?)<\\\/select>', 'gmi')
const str = `<select name="ctl00\$ContentPlaceHolder1\$UrunListesi\$ctrl0\$StokBoyut" id="ctl00_ContentPlaceHolder1_UrunListesi_ctrl0_StokBoyut">
<option value="900061_50x80">50x80 Stok:0</option>
<option value="900067_60x110">60x110 Stok:0</option>
<option value="900037_70x140">70x140 Stok:0</option>
<option value="356593_80 T.Yolluk">80 T.Yolluk Stok:2</option>
<option value="356552_80x150">80x150 Stok:23</option>
</select>
`;
// 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