Page is a not externally linkable
santapaws - 7:47 pm on Sep 26, 2012 (gmt 0)
I am trying to load a string into a variable. The string im trying to pick out is between a div and its closing tag. The text after the div may span line breaks. Im trying to come up with an expression to capture the text between <div class="tag"> and its closing </div>
i want to include the div in the variable. I have come up with
(?=<div\sclass="tag")(.|\n)*.(?<=</div>)
this is to cover instances where the text between the tags may be on a different line.
but when i run it the variable includes text after the prefix (</div>), so i realise its matching to the end of the page and then the last closing div on that page instead of the one straight after the suffix (<div class="tag">.
So my question is how to match between that suffix and the next closing div instead of last closing div.
Thanks for any help.