xref: /PHP-7.1/ext/pcre/tests/bug52971.phpt (revision 43206c8c)
1--TEST--
2Bug #52971 (PCRE-Meta-Characters not working with utf-8)
3--SKIPIF--
4<?php if ((double)PCRE_VERSION < 8.1) die('skip PCRE_VERSION >= 8.1 is required!'); ?>
5--FILE--
6<?php
7
8$message = 'Der ist ein Süßwasserpool Süsswasserpool ... verschiedene Wassersportmöglichkeiten bei ...';
9
10$pattern = '/\bwasser/iu';
11preg_match_all($pattern, $message, $match, PREG_OFFSET_CAPTURE);
12var_dump($match);
13
14$pattern = '/[^\w]wasser/iu';
15preg_match_all($pattern, $message, $match, PREG_OFFSET_CAPTURE);
16var_dump($match);
17
18?>
19--EXPECTF--
20array(1) {
21  [0]=>
22  array(1) {
23    [0]=>
24    array(2) {
25      [0]=>
26      string(6) "Wasser"
27      [1]=>
28      int(61)
29    }
30  }
31}
32array(1) {
33  [0]=>
34  array(1) {
35    [0]=>
36    array(2) {
37      [0]=>
38      string(7) " Wasser"
39      [1]=>
40      int(60)
41    }
42  }
43}
44