Hey Folks,
I am entirely new to regex, and am trying to use it to match vales in order to map them to variables (javascript looking at the output in responceText generated from a php script).
At the moment I have this code:
if (xmlhttp.readyState==4)
{
document.getElementById("test").innerHTML=xmlhttp.responseText;
cmake = xmlhttp.responseText.match(/Combined_Make =(.*?)</);
}
Here is the (part) of the output its looking at:
echo "<span class=\"note\">";
echo "Test Output\n";
echo " Combined_Make = $model\n";
echo " Combined_Model = $marque\n";
when everything runs, its actually looking at a line like:
Combined_Make = GRAND JEEP CHEROKEE<br />
At the moment I am getting back precisely this:
'Combined_Make = GRAND JEEP CHEROKEE>, GRAND JEEP CHEROKEE'
Of course I am after just 'GRAND JEEP CHEROKEE' in this instance :) - I am also unsure why I am getting back that precise output!
Please note that I will need to assign multiple var$, each using a different start sting for the match!
Thanks in advance for any help!