Say, I have a string like
<body class="body-element" style="background: red;"><div class="inner">...</div></body>
I would like to extract all attributes of body tag. As for jQuery parsing ignores body tag I can't use it. So, how to do it using regular expressions?
I need to extract attributes only from the body tag.

document.querySelector('body').attributesinstead.(new DOMParser()).parseFromString('<body class="body-element" style="background: red;"></body>', 'application/xml').querySelector('body').attributes. Check developer.mozilla.org/en-US/docs/Web/API/DOMParser