emacs-devel
[Top][All Lists]
Advanced

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

Re: Scan of regexps in Emacs (March 17)


From: Stefan Monnier
Subject: Re: Scan of regexps in Emacs (March 17)
Date: Tue, 02 Apr 2019 12:58:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> (string-match "\xff"     "\xff")  => 0
> (string-match "[\xff]"   "\xff")  => 0
> (string-match "\xffé?"   "\xff")  => nil
> (string-match "[\xff]é?" "\xff")  => 0
> (string-match "\xff"     "\xffé") => 0
> (string-match "[\xff]"   "\xffé") => nil
> (string-match "\xffé?"   "\xffé") => 0
> (string-match "[\xff]é?" "\xffé") => nil

Check (multibyte-string-p "...") on those strings, to see some of the
reasons why.  IIRC the treatment of those escape sequences to determine
unibyte/multibyte strings is pretty tricky (last time I looked at it,
I found its behavior to be undesirable, but I believe it has slightly
changed since and I can't remember what were the problems I bumped
into).


        Stefan




reply via email to

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