Regex match and Backwards Parsing
Heres the section of code i need to parse data from in an html source:
Code:
<li class="comment"
data-tag="R"
data-author-viewing=""
data-id="6vjI8OA5Lv7RkjBnqcOaIoSjCIxT4qpNYSCBT80a590"
data-score="28"
data-author="timmymcfunn">
<div class="content">
<div class="comment-text" dir="ltr">
<p>must... not... blink...</p>
</div>
</div>
What im trying to do is perfrom a regex match to locate particular blocks of this code, locating by matching the input between <p></p> tags. And the data i need to grab is the data-id/score/tag. But how can i grab data behind the location im matching to? My regex.match can bring me to the comment block i need data from, but how do i go about parsing backwards since the data i need for that comment is located backwards.