1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 00:48:25 +02:00

Add %S and %A to EXPECTF, they work like %s and %a but match empty strings, too

This commit is contained in:
Johannes Schlüter
2008-10-19 18:04:35 +00:00
parent 78325e3f94
commit 35db77d890
+2
View File
@@ -1752,7 +1752,9 @@ COMMAND $cmd
// Stick to basics
$wanted_re = str_replace('%e', '\\' . DIRECTORY_SEPARATOR, $wanted_re);
$wanted_re = str_replace('%s', '[^\r\n]+', $wanted_re);
$wanted_re = str_replace('%S', '[^\r\n]*', $wanted_re);
$wanted_re = str_replace('%a', '.+', $wanted_re);
$wanted_re = str_replace('%A', '.*', $wanted_re);
$wanted_re = str_replace('%w', '\s*', $wanted_re);
$wanted_re = str_replace('%i', '[+-]?\d+', $wanted_re);
$wanted_re = str_replace('%d', '\d+', $wanted_re);