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
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}. Inrethey are not:U+2160 ROMAN NUMERAL ONE is
gc=NlwithOther_Uppercase=Yes. 163 characters match\p{Uppercase}or\p{Lowercase}but not\p{Alphabetic}, which matchesGeneral_Category=Lexactly, the same set as\p{L}. The POSIX alias\p{alpha}behaves the same way.Doc/library/re.rstlistsAlphabeticamong the supported binary properties and names onlyspaceandxdigitas deviations from UTS #18 RL1.2.Expected:
\p{Alphabetic}matches the UCD property, or the deviation is documented alongsidespaceandxdigit.Not gh-56940 (
\wunder RL1.2a, predates\p{...}), and not covered by GH-153023, whose properties are the enumerated ones plusccc,Bidi_MirroredandExtended_Pictographic.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux