I have a variable htmlSource
containing HTML code like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 8.0 Detailed Error - 404.0 - Not Found</title>
</head>
<body>xxx some code here yy</body>
</html>
How can I create a new variable htmlBodyOnly
that contains only "xxx some code here yy". If possible I would like to do this with a regular expression. I am just not sure how to exclude the start and end using a regex or something similar.
Sorry but I don't have jQuery to use to help. I am working just on a javascript variable. Not working on the DOM.
"))`, though again, this assumes consistent markup is being sent.
– cookie monster Jun 19 '14 at 18:41