10000 The `\X` matcher doesn't catch all symbols · Issue #361 · PCRE2Project/pcre2 · GitHub
[go: up one dir, main page]

Skip to content
The \X matcher doesn't catch all symbols #361
@alexandre-daubois

Description

@alexandre-daubois

Hi! 👋

We're facing an issue in the Symfony repository in the CI: https://ci.appveyor.com/project/fabpot/symfony/builds/48712798

The problems comes from the Grapheme Cluster polyfill when the php-intl extension is not available. This polyfill uses the \X matcher of PCRE to get the length of a unicode string. However, it seems the it dosen't work with symbols. Indeed, for the following sequence:

☢☎❄

The \X matcher returns a length of 1, where 3 is expected. Here's the reproducer: https://3v4l.org/C0UuO. As you can see, the $matches array only returns 1 result containing all three symbols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0