python / python/cpython

`\p{Alphabetic}` matches `gc=L`, not the Unicode Alphabetic property

Ouverte
#155,498 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

@serhiy-storchaka y travaille déjà.

Depuis le 16/8/2026.

stdlib topic-regex type-bug
Langage dominant
Python
Étoiles
77.2k
Forks
35.9k
Métriques de merge des PR
Métriques de PR en attente

Description

Bug description:

The Unicode Alphabetic property is derived as Uppercase + Lowercase + Lt + Lm + Lo + Nl + Other_Alphabetic, so \p{Uppercase} and \p{Lowercase} are subsets of \p{Alphabetic}. In re they are not:

$ ./python -c "import re; print(bool(re.fullmatch(r'\p{Uppercase}', 'Ⅰ')), bool(re.fullmatch(r'\p{Alphabetic}', 'Ⅰ')))"
True False

U+2160 ROMAN NUMERAL ONE is gc=Nl with Other_Uppercase=Yes. 163 characters match \p{Uppercase} or \p{Lowercase} but not \p{Alphabetic}, which matches General_Category=L exactly, the same set as \p{L}. The POSIX alias \p{alpha} behaves the same way. Doc/library/re.rst lists Alphabetic among the supported binary properties and names only space and xdigit as deviations from UTS #18 RL1.2.

Expected: \p{Alphabetic} matches the UCD property, or the deviation is documented alongside space and xdigit.

Not gh-56940 (\w under RL1.2a, predates \p{...}), and not covered by GH-153023, whose properties are the enumerated ones plus ccc, Bidi_Mirrored and Extended_Pictographic.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.