emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: category codes and regexps


From: Werner LEMBERG
Subject: Re: category codes and regexps
Date: Mon, 26 Jul 2004 04:05:51 +0200 (CEST)

> > 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]