mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Fix "%f" regex in run-tests.php (#8965)
"-.0.0" and "0." is no longer matched wrongly
This commit is contained in:
parent
d217a669fc
commit
6cd5bd1bcd
1 changed files with 1 additions and 2 deletions
|
@ -2583,10 +2583,9 @@ COMMAND $cmd
|
|||
$wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
|
||||
$wanted_re = str_replace('%d', '\d+', $wanted_re);
|
||||
$wanted_re = str_replace('%x', '[0-9a-fA-F]+', $wanted_re);
|
||||
$wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $wanted_re);
|
||||
$wanted_re = str_replace('%f', '[+-]?(?:\d+|(?=\.\d))(?:\.\d+)?(?:[Ee][+-]?\d+)?', $wanted_re);
|
||||
$wanted_re = str_replace('%c', '.', $wanted_re);
|
||||
$wanted_re = str_replace('%0', '\x00', $wanted_re);
|
||||
// %f allows two points "-.0.0" but that is the best *simple* expression
|
||||
}
|
||||
|
||||
if (preg_match("/^$wanted_re\$/s", $output)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue