Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Unicode blocks #242

Open
BenjaminGalliot opened this issue Apr 26, 2023 · 0 comments
Open

Support for Unicode blocks #242

BenjaminGalliot opened this issue Apr 26, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@BenjaminGalliot
Copy link

BenjaminGalliot commented Apr 26, 2023

It would be nice to be able to match Unicode blocks (like \p{Block=Combining_Diacritical_Marks} or \p{Block=CJK_Symbols_and_Punctuation}). I did not find a way to do it without using ranges…

From https://www.regular-expressions.info/unicode.html :

Unicode Blocks

The Unicode standard divides the Unicode character map into different blocks or ranges of code points. Each block is used to define characters of a particular script like “Tibetan” or belonging to a particular group like “Braille Patterns”. Most blocks include unassigned code points, reserved for future expansion of the Unicode standard.

Note that Unicode blocks do not correspond 100% with scripts. An essential difference between blocks and scripts is that a block is a single contiguous range of code points, as listed below. Scripts consist of characters taken from all over the Unicode character map. Blocks may include unassigned code points (i.e. code points matched by \p{Cn}). Scripts never include unassigned code points. Generally, if you’re not sure whether to use a Unicode script or Unicode block, use the script.

[…]

The actual names of the blocks are the same in all regular expression engines. The block names are defined in the Unicode standard. PCRE and PHP do not support Unicode blocks, even though they support Unicode scripts.

@PhilipHazel PhilipHazel added the enhancement New feature or request label Apr 26, 2023
@NWilson NWilson self-assigned this Jan 8, 2025
@NWilson NWilson added this to the 10.46 milestone Jan 8, 2025
@NWilson NWilson removed their assignment Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants