Skip to content

Grapheme cluser (\X) selector capturing multiple characterΒ #410

Closed

Description

@Ayesh

Using PCRE2 10.43, the \X selector seems to capture more than one graphemes, as if does not break before the start of a new grapheme cluster.

Regex: \X
Input: πŸ³οΈβ€πŸŒˆπŸ΄β€β˜ οΈ (U+1F3F3 U+FE0F U+200D U+1F308 + U+1F3F4 U+200D U+2620 U+FE0F)

When run, \X matches both flag graphemes: Regex101 preview.

Could you kindly shed me a light if I'm missing something?

Thank you.

Activity

  1. PhilipHazel commented on Jun 3, 2024

    @PhilipHazel
    Collaborator

    This is a bug, caused by my misreading or misunderstanding one of the rules in Unicode Annex 29, way back when I implemented \X. I'm a bit surprised it's taken so long for it to hit anybody. Furthermore, the documentation correctly describes what the code does, but it's not what it's supposed to do! (Somewhere I even noted a difference from Perl, but never investigated.) I hope to have this fixed in HEAD in the next day or two. This is a very timely issue because the 10.44 release will be forthcoming once this fix is done. Thanks for the report.

  2. Ayesh commented on Jun 5, 2024

    @Ayesh
    ContributorAuthor

    Thank you. I tested after commit 067c2f1, it worked correctly!

  3. added a commit that references this issue on Jun 8, 2024
  4. 7 remaining items

  5. added a commit that references this issue on Sep 9, 2024
  6. added 2 commits that reference this issue on Jun 24, 2025
  7. added 2 commits that reference this issue on May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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