coolcamo8642
02-17-2011, 08:28 PM
I've got the following sets of code I'm trying to extract data from using a regular expression:
<TD STYLE=text-align:center;background-color:yellow;color:red;font-size:10px;font-weight:bold; CLASS="dedefault"><p class="centeraligntext">ONLINE COURSE
</TD>
<TD STYLE=text-align:center;font-size:10px;background:WHITE; CLASS="dedefault"><p class="centeraligntext">
3
</TD>
I'd like to extract both the "ONLINE COURSE" and the "3"; this is the expression I'm using right now:
$REGEX_3='#\<p class\=\"centeraligntext\"\>(.+?)\<\/TD\>#s';
Since one value is on the same line as the <p> and the other isn't, I need it to ignore the linebreak so that both can be detected with the same expression. I've tried adding \m to make it multiline, but I don't know where precisely to put it at. I've tried a few different spots, but even when it's not causing a syntax error, it doesn't work.
Can anyone tell me how I need to modify the expression to ignore linebreaks?
Thanks in advance.
<TD STYLE=text-align:center;background-color:yellow;color:red;font-size:10px;font-weight:bold; CLASS="dedefault"><p class="centeraligntext">ONLINE COURSE
</TD>
<TD STYLE=text-align:center;font-size:10px;background:WHITE; CLASS="dedefault"><p class="centeraligntext">
3
</TD>
I'd like to extract both the "ONLINE COURSE" and the "3"; this is the expression I'm using right now:
$REGEX_3='#\<p class\=\"centeraligntext\"\>(.+?)\<\/TD\>#s';
Since one value is on the same line as the <p> and the other isn't, I need it to ignore the linebreak so that both can be detected with the same expression. I've tried adding \m to make it multiline, but I don't know where precisely to put it at. I've tried a few different spots, but even when it's not causing a syntax error, it doesn't work.
Can anyone tell me how I need to modify the expression to ignore linebreaks?
Thanks in advance.