Jump to content

Simple Regex I can't get right


keeB

Recommended Posts

I am manually parsing an HTML doc and want to read each row of a table. The HTML I want to gather looks like this:

 

    <tr class=mbrow1>
      
      <td align=center><img src="/images/boards/closed.gif" border=0 alt="Locked thread"></td>
      <td>Pinned: <a href="/tool/post/scbbbc/vpost?id=1038138">Message Board Policies - *Please Read*</a></td>
      <td><a href="/tool/view/mb/profile/scbbbc/Kodiakjo" title="View profile">Kodiakjo</a></td>

      <td align=center>787</td>

      <td align=center>0</td>
      <td>
            <table cellpadding="0" cellspacing="0" border="0" width="100%" class=mbrow1><tr>
            <td>04/06/06 at 10:35 AM by <a href="/tool/view/mb/profile/scbbbc/Kodiakjo" title="View profile">Kodiakjo</a></td>
            <td align="right" nowrap> <a href="/tool/post/scbbbc/vpost?id=1038138&trail=#1"><img src="/images/boards/page.gif" border="0" alt="Go to last post" title="Go to last post"></a></td>

            </tr></table>
      </td>
    </tr>

 

The regex I have so far is:

 

"<tr class=mbrow\d+>(.*)</tr>"

 

 

That appears to be grabbing the first instance of mbrow1 and grabbing the LAST </tr>

 

How to make it grab first instance of </tr> ?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.