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