xref: /PHP-7.4/ext/pcre/tests/ungreedy.phpt (revision 577ed5bf)
1--TEST--
2U (PCRE_UNGREEDY) modifier
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