Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Regex Question

Last post 05-13-2008, 8:49 PM by Aussie Susan. 2 replies.
Sort Posts: Previous Next
  •  05-13-2008, 6:41 PM 42215

    Regex Question

    I have question on how to write a regex for a particular string. You see I'm trying to extract the number between the <td></td> tags but I can't seem to find an expression that would do just that. If anyone could help it would be appreciated.

     

    &nbsp;<a href="/gamecenter?game_id=29208&displayPage=tab_gamecenter&season=2007&week=REG1">45-35</a> 
    </td>
    <td>
    15
    </td>
    <td>
    24
    </td>
    <td>
    345
    </td>
    <td>
    4
    </td>
    <td>
    1
    </td>
    <td>
    1
    </td>
    <td>
    													0
    </td>
    <td>
    128.5
    </td></tr>
  •  05-13-2008, 6:58 PM 42216 in reply to 42215

    Re: Regex Question

    Here's a partial answer:

    <td>\s*([\d\.]*)<\/td>

  •  05-13-2008, 8:49 PM 42222 in reply to 42216

    Re: Regex Question

    Given the sample text, wouldn't:

    <td>\s*([\d\.]*)\s*</td>

    be better to handle the spaces after the number and before the closing tag?

    Susan 

View as RSS news feed in XML