JSFiddle - React, Tailwind, and code Playground
HTML
<pre id="result"></pre>
JavaScript
var data = "<test>11\n1</test>\n#EXTM3U\n";
reg = /<test>([\s\S]*?)<\/test>/;
var match = data.match(reg);
document.getElementById('result').textContent = match.toString();
console.log(match);