I want to do a regex in JAVA that returns me all between the tag , but i want exclude the tag. I have this code:
Pattern pattern = Pattern.compile("(?s)<body(\\s|\\S)*>(\\s|\\S)*</body>");
Matcher matcher = pattern.matcher(str);
matcher.find();
System.out.println(matcher.group(0));
with this on my str variable
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>dpioaushd iuashdiu ashd</p>
<p> has</p>
<p>ud ashuod sh</p>
<p>odu sad ha</p>
<p>suod sh</p>
<p>od uashod uahd<br>
</p>
<div class="moz-signature">-- <br>
<img src="cid:part1.8C289150.C3F89C42@wssim.com.br" border="0"></div>
</body>
</html>
And that is my return
<body text="#000000" bgcolor="#FFFFFF">
<p>dpioaushd iuashdiu ashd</p>
<p> has</p>
<p>ud ashuod sh</p>
<p>odu sad ha</p>
<p>suod sh</p>
<p>od uashod uahd<br>
</p>
<div class="moz-signature">-- <br>
<img src="cid:part1.8C289150.C3F89C42@wssim.com.br" border="0"></div>
</body>
but I want this return:
<p>dpioaushd iuashdiu ashd</p>
<p> has</p>
<p>ud ashuod sh</p>
<p>odu sad ha</p>
<p>suod sh</p>
<p>od uashod uahd<br>
</p>
<div class="moz-signature">-- <br>
<img src="cid:part1.8C289150.C3F89C42@wssim.com.br" border="0"></div>
How can I do to exclude the tag body with my macher?