I have the following html table –
<table cellpadding=0 cellspacing=0><tr><td height=\'30\' bgcolor=\'#CCCACA\'>
<font size=2 face=\'Arial\' color=\'#000000\'><b> Property</b></font>
</td><td bgcolor=\'#CCCACA\'>
<font size=2 face=\'Arial\' color=\'#000000\'><b> Value</b></font>
</td></tr><tr><td bgcolor=\'white\' width=\'200\' height=\'20\'>
<font size=2 face=\'Arial\'> First Name</font>
</td><td bgcolor=\'white\' width=\'300\'>
<font size=2 face=\'Arial\'> John</font>
</td></tr><tr><td bgcolor=\'#F3EFEF\' width=\'200\' height=\'20\'>
<font size=2 face=\'Arial\'> Contact</font>
</td><td bgcolor=\'#F3EFEF\' width=\'300\'>
<font size=2 face=\'Arial\'> number</font>
</td></tr><tr><td bgcolor=\'white\' width=\'200\' height=\'20\'>
<font size=2 face=\'Arial\'> Last Name</font>
</td><td bgcolor=\'white\' width=\'300\'><font size=2 face=\'Arial\'> Smith</font>
</td></tr></tr></table>
I am looking to use a regular expression in Javascript to extract the number value out of this code. My problem being that before every value in the table the line of code –
<font size=2 face=\'Arial\'>
is present therefore I cannot localise to one value. However I do know that the number value will occur after every 6th instance of the aforementioned line. I am aware a regular expression could extract the values after   how ever not sure how to 1. Implement this and 2. Get to the 6th value.
EDIT
function showProperties2(){
var itemID = new String(objChart.getSelectedElements());
var props = new String(objChart.getItemsPropertyIDs(itemID));
var arrPropIDs = props.split(',');
var propertyHTML="<table cellpadding=0 cellspacing=0><tr><td height='30' bgcolor='#CCCACA'><font size=2 face='Arial' color='#000000'><b> Property</b></font></td><td bgcolor='#CCCACA'><font size=2 face='Arial' color='#000000'><b> Value</b></font></td></tr>";
var bgcolor="#F3EFEF";
var i=0;
for(i=0;i<arrPropIDs.length;i++){
if(objChart.getPropertyValue(itemID, arrPropIDs[i])!=""){
if(bgcolor=="#F3EFEF"){
bgcolor = "white";
}else{
bgcolor = "#F3EFEF";
}
propertyHTML+="<tr><td bgcolor='"+bgcolor+"' width='200' height='20'>";
propertyHTML+= "<font size=2 face='Arial' class='quack'> "+objChart.getPropertyDisplayName(itemID, arrPropIDs[i])+"</font>";
propertyHTML+="</td><td bgcolor='"+bgcolor+"' width='300'>";
propertyHTML+= "<font size=2 face='Arial' class='quack2'> "+objChart.getPropertyValue(itemID, arrPropIDs[i])+"</font>";
propertyHTML+="</td></tr>";
}
}
propertyHTML+="</tr></table>";
propertyWindow(propertyHTML, "Properties");
}
The previous is how I construct my table.
If you don’t mind using jQuery, this might work
Then call the function like getNumber($(‘#table-id’)) or just getNumber($(‘table’)) if there’s no id and there’s only one table on the page.
jsFiddle: http://jsfiddle.net/5Ggnz/1/