// Stick to basics
$wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy
$wanted_re = str_replace("%i", "[0-9]+", $wanted_re);
+ $wanted_re = str_replace("%d", "[0-9]+", $wanted_re);
+ $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re);
$wanted_re = str_replace("%f", "[0-9\.+\-]+", $wanted_re);
/* DEBUG YOUR REGEX HERE
var_dump($wanted);
print(str_repeat('=', 80) . "\n");
var_dump($output);
*/
- if (preg_match("/$wanted_re/s", $output)) {
+ if (preg_match("/^$wanted_re$/s", $output)) {
echo "PASS $tested\n";
return 'PASSED';
}