const regex = /(?s)(?<=<br><b>).+?(?=<br>)/g;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(?s)(?<=<br><b>).+?(?=<br>)', 'g')
const str = ` </table>
</td>
</tr>
<tr bgcolor="#257fba">
<td height="17" colspan="5" valign="top" align="right"><font color="#FFFFFF">Dienstag Sonnenscheindauer:</font></td>
<td height="17" colspan="1" valign="bottom" align="center"><font color="#FFFFFF">6-7 Stunden</font></td>
</tr>
<tr bgcolor="#257fba">
<td height="17" colspan="5" valign="top" align="right"><font color="#FFFFFF">Niederschlags-Wahrscheinlichkeit: </font></td>
<td height="17" colspan="1" valign="bottom" align="center"><font color="#FFFFFF">52 %</font></td>
</tr>
<tr>
<td colspan="6" align="left">
<br><b>Das Wetter in Reutlingen am Dienstag, 28.3.2017:</b> Am Vormittag wechselnd bewölkt bei 15 Grad, nachmittags sind neben Wolkenlücken bei 18 Grad auch Schauer möglich. Die Nacht verläuft wechselnd bewölkt bei Werten um 6 Grad.<br><br>
</td>
</tr>
<tr>
<td colspan="4" align="right">
<center>
<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span> Tag</button> <a href="/wetter/morgen/reutlingen/DE23046.html"><button type="button" class="btn btn-primary">Tag <span class="glyphicon glyphicon-arrow-right"></span></button></a>
</center>
</td>
<td colspan="2" align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr> `;
// 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