xref: /PHP-5.3/ext/pcre/tests/ungreedy.phpt (revision a7bc2866)
1--TEST--
2U (PCRE_UNGREEDY) modififer
3--FILE--
4<?php
5
6var_dump(preg_match('/<.*>/', '<aa> <bb> <cc>', $m));
7var_dump($m);
8
9var_dump(preg_match('/<.*>/U', '<aa> <bb> <cc>', $m));
10var_dump($m);
11
12var_dump(preg_match('/(?U)<.*>/', '<aa> <bb> <cc>', $m));
13var_dump($m);
14
15?>
16--EXPECT--
17int(1)
18array(1) {
19  [0]=>
20  string(14) "<aa> <bb> <cc>"
21}
22int(1)
23array(1) {
24  [0]=>
25  string(4) "<aa>"
26}
27int(1)
28array(1) {
29  [0]=>
30  string(4) "<aa>"
31}
32