]> granicus.if.org Git - php/commitdiff
- Added %x for HEX chars
authorDerick Rethans <derick@php.net>
Fri, 18 Oct 2002 20:34:41 +0000 (20:34 +0000)
committerDerick Rethans <derick@php.net>
Fri, 18 Oct 2002 20:34:41 +0000 (20:34 +0000)
- Added %d as alias for %i (too much C here :)
- Added beginning and end markers to regexp

run-tests.php

index 7821f490bd0922e8d6ce7719c52b54fce9778078..c668b2a8b700b8e58a8e2c8edfdbbbb3b7f596ab 100755 (executable)
@@ -528,13 +528,15 @@ COMMAND $cmd
                // 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';
                }