I am making a cfhttp call and getting the data back..
Now I am getting a complete page like below:
<html><title>MyPage</title><head><link rel="stylesheet" href="style.css"></head>
<body>
<table></table>
<table></table>
<table></table>
<table></table>
<table></table>
<table></table>
</body>
</html>
Now the issue I want the code which which is inside the body tag, and also remove the last table tag completely.
I am not sure where to start [p.s JSOUP is not an option]
tried like below but it did not yielded any results:
<cfset objPattern = CreateObject("java","java.util.regex.Pattern").Compile(JavaCast("string","(?i)<table[^>]*>([\w\W](?!<table))+?</table>"))>
<cfset objMatcher = objPattern.Matcher(JavaCast( "string", cfhttp.FileContent ))>
<cfoutput>#objMatcher#</cfoutput>