Regex help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shmulik28@yahoo.com

    #1

    Regex help

    I'm just getting my feet wet w/regex's and was wondering if someone
    could show me how to parse a piece of code.

    I'm screen scraping from a financial website and want to add the values
    into an object for processing - the data looks like this:

    <tr><td align="center"> 09/22/2004</td>
    <td align="right">1 0087.00</td>
    <td align="right">1 0087.00</td>
    <td align="right">1 0087.00</td>
    <td align="right">1 0087.00</td>
    <td align="right">0 </td>
    <td align="right">0 </td>
    </tr>


    (There are many additional items like this in a list). I wanted to
    parse each item out as such:

    (<tr>.*>)(?<dat e>dd/dd/dddd)(</td.*>)(?<openpr ice>.*)(</td.*) .. etc

    This doesn't pick up any groups - so (a), for the the first two group
    items, can someone point out what is wrong, and (b) how can I get the
    regex to span multiple lines? (Basically, I want to parse out the 7
    data points for each "record".

    TIA!

Working...