I want to find the index of tag in from the html output of a page in the http module. I am using
HTMLOutput.IndexOf("</head>");
where HTMLOutput is the string parameter which consist the whole html output of a particular page. with the above mentioned method i am able to find the Index of end head tag but only when it is the only end head tag, problem arises when there are some javascript functions within the page which insert some dynamic html content and contains some end head tag within it for example,
newWindow.document.writeln('</head>')
and also if there are some comment lines within the page added by some third party tools which contains within it.
So i am not able to find the index of original tag, does some one have any idea how to tackle this may be some regular expression or something which can help me in this scenario.
Thanks, Mac