I'm having a problem where I cant seem to get the contents around an expression to be matched. This expression works just fine:
$expression = '/<input type=\"text\" class=\"pagetext\" NAME=\"qty\" size=3 value=\"626\" MAXLENGTH=\"3\">/i';
echo preg_replace($expression,"ya",$result);
This will replace the input box within the source with the word 'ya'. What I want it to do is to replace the entire page with the word 'ya'. so I tried:
$expression = '/^.*<input type=\"text\" class=\"pagetext\" NAME=\"qty\" size=3 value=\"626\" MAXLENGTH=\"3\">.*$/i';
echo preg_replace($expression,"ya",$result);
And the expression couldnt be found. I have dumbed the expression down...its main function will eventually be to parse out the numeric number 626(which is an unknown number).
Tags: