From: Werner LEMBERG <wl@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: category codes and regexps
Date: Mon, 26 Jul 2004 04:05:51 +0200 (CEST) [thread overview]
Message-ID: <20040726.040551.172934020.wl@gnu.org> (raw)
In-Reply-To: <200407252359.IAA03317@etlken.m17n.org>
> > Assume that I want to check a buffer for characters which aren't Thai,
> > and which aren't in the range a-z. [...]
> Unfortunately [...] can't be used with category nor syntax.
>
> [ ^ a - z ESC : (insert (make-char 'thai-tis620 #x20)) RET
> - ESC : (insert (make-char 'thai-tis620 #x7f)) RET
> ]
>
> will produce a regex that you want.
>
> Another way is to make a new category (say, menumonic `T')
> that contains a-z and Thai. Then you can specify:
> \CT
Thanks for the quick reply. Both solutions are much uglier than
expected :-(
Wouldn't it be possible to extend the [...] syntax, say, to use the
already existing [:...:] character classes construct:
[^a-z[:\ct:]]
At first sight, I can't see a conflict.
Werner
PS: In elisp.info, the sentence
For the description of the known categories, type `M-x
describe-categories <RET>'.
is missing at the end of the description of `\cC' (in node `Regexp
Backslash'). In general, it would be useful to unify the regexp
descriptions of emacs.info and elisp.info.
Finally, the output of `describe-categories' is very crude and
probably causes some worries for the beginner. Maybe this can be
beautified, with some explanations at the beginning.
next prev parent reply other threads:[~2004-07-26 2:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-25 20:59 category codes and regexps Werner LEMBERG
2004-07-25 23:59 ` Kenichi Handa
2004-07-26 2:05 ` Werner LEMBERG [this message]
2004-07-26 19:26 ` Stefan Monnier
2004-07-26 19:48 ` David Kastrup
2004-07-26 21:14 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040726.040551.172934020.wl@gnu.org \
--to=wl@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).