Edit report at https://bugs.php.net/bug.php?id=76033&edit=1
ID: 76033
User updated by: master at hiroz dot cn
Reported by: master at hiroz dot cn
Summary: some words, preg_match_all can't match big S
correctly
Status: Open
Type: Bug
Package: PCRE related
Operating System: macOS 10.12.6
PHP Version: 5.6.33
Block user comment: N
Private report: N
New Comment:
I reproduce it in 5.4~5.6.33 in macOS. In Linux all versions works fine.
In macOS, 5.7 works fine too.
If these versions only received in security support, I think it can be ignored.
Previous Comments:
------------------------------------------------------------------------
[2018-03-06 18:12:20] jhdxr@php.net
I cannot reproduce this bug as well.
In addition, did you try php 7.1 or above? 5.6 only received in security support.
------------------------------------------------------------------------
[2018-03-01 13:12:54] master at hiroz dot cn
please try it in macOS again.
------------------------------------------------------------------------
[2018-03-01 12:03:27] cmb@php.net
I cannot reproduce the described behavior:
<https://3v4l.org/UeP92>.
------------------------------------------------------------------------
[2018-03-01 03:29:10] master at hiroz dot cn
Description:
------------
preg_match_all can't match \S correctly
in php5.4 ~ php5.6.33
```
$matches = array();
$template = '<p>{{{ åè´§åå· }}}</p><p>{{{
åæ®123å· }}}</p><p>{{{ æå }}}</p><p>{{{ a
}}}</p><p>{{{ a }}}</p>';
$ret = preg_match_all('/\{\{\{ \S+ \}\}\}/', $template, $matches);
print_r($matches);
```
result is
```
Array
(
[0] => Array
(
[0] => {{{ åè´§åå· }}}
[1] => {{{ åæ®123å· }}}
[2] => {{{ a }}}
[3] => {{{ a }}}
)
)
```
the "æå " is missing. i try many cases. "å " can't be matched
by "\S".
but in php5.3 or other languages, "å " can be matched by "\S".
Test script:
---------------
$matches = array();
$template = '<p>{{{ åè´§åå· }}}</p><p>{{{
åæ®123å· }}}</p><p>{{{ æå }}}</p><p>{{{ a
}}}</p><p>{{{ a }}}</p>';
$ret = preg_match_all('/\{\{\{ \S+ \}\}\}/', $template, $matches);
print_r($matches);
Expected result:
----------------
Array
(
[0] => Array
(
[0] => {{{ åè´§åå· }}}
[1] => {{{ åæ®123å· }}}
[2] => {{{ æå }}}
[3] => {{{ a }}}
[4] => {{{ a }}}
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[0] => {{{ åè´§åå· }}}
[1] => {{{ åæ®123å· }}}
[2] => {{{ a }}}
[3] => {{{ a }}}
)
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76033&edit=1