I have this html content
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center><img style="margin-left: auto; display: block; margin-right: auto;" src="../img/escudocaba.png" alt="#" width="470" height="90" /></center>
<h1>Hoddda</h1>
</body>
</html>
I need to extract the content of the body without including the body tags. I have made this regex that match perfectly:
/<body[^>]*>(.*?)<\/body>/is
as you can see in this website
But when I use it
var bodyHtml=$editor.val().match( /<body[^>]*>(.*?)<\/body>/is);
I get no results.......Also tried a similar regex which did not work out in the end with the same format and without modifiers and it was matching
var bodyHtml=$editor.val().match(/(?:.(?!<\s*body[^>]*>))*\>.+/);
for example returned
<center><img style="margin-left: auto; display: block; margin-right: auto;" src="../img/escudocaba.png" alt="#" width="470" height="90" /></center>
How can I do in this case to use regex modifiers with this jquery function?. Thanks