Regex - how to extract number which falls on specified ID?
Posted
by
cbros2008
on Stack Overflow
See other posts from Stack Overflow
or by cbros2008
Published on 2012-06-01T16:34:22Z
Indexed on
2012/06/01
16:40 UTC
Read the original article
Hit count: 202
I'm trying to extract the number '1' that appears on the line with the ID I'm feeding (i.e. 12072).
I've been trying for the past 2 hours to get this regex to work but I'm at a loss. So far I've got
12072.*?(\d+)(?!.*\d)
but this extracts me everything from 12072 to the 1. Here's the text:
<td id="12072" scope="#999999" bgcolor="#999999" style="width: 65; color:#999999" align="center" onclick="DaySelect(this)" title="">1</td>
<td id="12073" scope="#999999" bgcolor="#999999" style="width: 65; color:#999999" align="center" onclick="DaySelect(this)" title="">1</td>
How can I match just the number 1 from the end of the line of the specified ID, surely there's a way to do this?
Help would be highly appreciated.
© Stack Overflow or respective owner