emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: phps-mode


From: Stefan Monnier
Subject: Re: [ELPA] New package: phps-mode
Date: Wed, 17 Jul 2019 08:24:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Ah I missed that, the original re2c regex is
> [a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*

I strongly suspect that this regexp is applied to a stream of *bytes*,
whereas in phps-mode you're dealing with a stream of *characters*.

IOW for the re2c code, `λ` is the two byte sequence of \xCE and \xBB
(assuming the file is using utf-8) whereas in phps-mode it's just `λ` or
\u03BB.

So the regexp above actually matches all the non-ascii Unicode chars,
assuming the file uses utf-8.

> But I’m not sure about the equivalent in emacs-lisp but I know PHP does not 
> fully support UTF-8 yet.

In that case, maybe

    [[:alpha:]_][[:alnum:]_]*

is the saner choice.


        Stefan




reply via email to

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