const reg = /(.+\n)([\s\S]*)/g;
const txt =
`2
<p><a href="http://www.quackit.com/html/tutorial/html_links.cfm">Example Link</a></p>
<div class="more-info"><a href="http://www.quackit.com/html/examples/html_links_examples.cfm">More Link Examples...</a></div>
`;
const result = reg.exec(txt);
for (let [index, str] of result.entries()) {
if(index === 0) {
}
console.log(index);
}