Regex test

by Максим Булавинов

HTML

<pre id="output"></pre>

JavaScript

let regexp = /(?<=<body(\s.*)?>)/;

let str = `
<html>
  <body style="height: 200px">
  ...
  </body>
</html>
`;

str = str.replace(regexp, `<h1>Hello</h1>`);

$("#output").text(str);