php-src/ext/pcre/tests/ungreedy.phpt
2006-06-14 17:37:53 +00:00

32 lines
431 B
PHP

--TEST--
U (PCRE_UNGREEDY) modififer
--FILE--
<?php
var_dump(preg_match('/<.*>/', '<aa> <bb> <cc>', $m));
var_dump($m);
var_dump(preg_match('/<.*>/U', '<aa> <bb> <cc>', $m));
var_dump($m);
var_dump(preg_match('/(?U)<.*>/', '<aa> <bb> <cc>', $m));
var_dump($m);
?>
--EXPECT--
int(1)
array(1) {
[0]=>
string(14) "<aa> <bb> <cc>"
}
int(1)
array(1) {
[0]=>
string(4) "<aa>"
}
int(1)
array(1) {
[0]=>
string(4) "<aa>"
}