I'm trying to get better at using Emacs regular expressions. Reading the documentation I see:
‘\cC’
matches any character that belongs to the category C. For example, ‘\cc’ matches Chinese characters, ‘\cg’ matches Greek characters, etc. For the description of the known categories, type‘M-x describe-categories <RET>’
.
If I run describe-categories
I see:
Legend of category mnemonics (longer descriptions at the bottom)
:space for indent 9:semivowel lower R:Right-to-left ... k:Katakana
.:Base <:Not at eol Y:2-byte Cyrillic l:Latin
0:consonant >:Not at bol ^:Combining o:Lao
1:base vowel A:2-byte alnum a:ASCII q:Tibetan
2:upper diacritic C:2-byte han b:Arabic r:Roman
3:lower diacritic G:2-byte Greek c:Chinese t:Thai
4:combining tone H:2-byte Hiragana e:Ethiopic v:Viet
5:symbol I:Indian Glyphs g:Greek w:Hebrew
6:digit K:2-byte Katakana h:Korean y:Cyrillic
...
Isn't that first item the space character? But if run isearch-forward-regexp
and try \c
, it finds nothing, even in a buffer with lots of whitespace. Trying \c6
to find digits also doesn't work.
Are these bugs or am I using it wrong?
I'm using GNU Emacs 27.2 on macOS.