help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Match empty string at begin/end of symbol


From: Noam Postavsky
Subject: Re: Match empty string at begin/end of symbol
Date: Wed, 4 Jul 2018 15:21:07 -0400

On 4 July 2018 at 14:43, Joe Riel <joer@san.rr.com> wrote:

> That returns "ab", as expected.  Change the "\\<" to "\\_<"
> and it no longer matches.  Why not?
>
> (let ((str "3+ab"))
>   (and (string-match "\\_<[a-zA-Z][a-zA-Z0-9]*" str)
>        (match-string 0 str)))

"+ab" all have symbol syntax in lisp-mode, try evaluating it from a
c-mode buffer and you will get "ab".



reply via email to

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