[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1877: Request: Regular expressions that can match Unicode general ca
From: |
Lars Ingebrigtsen |
Subject: |
bug#1877: Request: Regular expressions that can match Unicode general categories |
Date: |
Mon, 30 Sep 2019 09:45:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Derick Eddington <derick.eddington@gmail.com> writes:
> A new Scheme major mode I've made [1] requires regular expressions that
> can match characters by their Unicode general categories. It seems
> Emacs regular expressions do not provide a way to do that directly (I'm
> using GNU Emacs 23.0.60.1)
(I'm going through old bug reports that unfortunately didn't get any
response at the time.)
I'm not quite sure what Unicode general categories you're referring to,
but the Emacs regexp matcher has gained a bunch of categories in the ten
years since you made the request.
Are the categories below what you were thinking of?
‘[:print:]’
This matches any printing character—either whitespace, or a graphic
character matched by ‘[:graph:]’.
‘[:punct:]’
This matches any punctuation character. (At present, for multibyte
characters, it matches anything that has non-word syntax.)
‘[:space:]’
This matches any character that has whitespace syntax (*note Syntax
Class Table::).
‘[:upper:]’
This matches any upper-case letter, as determined by the current
case table (*note Case Tables::). If ‘case-fold-search’ is
non-‘nil’, this also matches any lower-case letter.
‘[:word:]’
This matches any character that has word syntax (*note Syntax Class
Table::).
(etc)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#1877: Request: Regular expressions that can match Unicode general categories,
Lars Ingebrigtsen <=