| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A negated multi-range property such as \P{ASCII} or \P{Pattern_Syntax} was
rejected inside a character class. Such members are now alternated in with
the other members: [\P{ASCII}abc] becomes [abc] | [^ASCII], and [\P{ASCII}]
alone is just the negated charset.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Follow-up to gh-95555 (#151969).
A negated multi-range property such as \P{ASCII} or \P{Pattern_Syntax} was rejected inside a character class. Such a property compiles to a complemented charset, so it could not simply be flattened into the member union. It is now set aside and alternated in with the other members:
Leading ^ (De Morgan) and double negation ([^\P{ASCII}] = ASCII) are handled by the existing set-complement code, and it composes with the set operations: [\w--\P{ASCII}] is the ASCII word characters.
Category-backed \P{...} (e.g. \P{Lu}, \P{digit}), which is a single CATEGORY opcode, always composed fine; only the multi-range properties were affected.
No news entry: \p{...} is unreleased (.. versionadded:: next), so the lifted restriction never shipped.