[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Match empty string at begin/end of symbol
From: |
Joe Riel |
Subject: |
Match empty string at begin/end of symbol |
Date: |
Wed, 4 Jul 2018 11:43:46 -0700 |
The regular expressions '\_<' and '\_>'
seem to be broken in Emacs 25.1.1. Consider
(let ((str "3+ab"))
(and (string-match "\\<[a-zA-Z][a-zA-Z0-9]*" str)
(match-string 0 str)))
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)))
--
Joe Riel
- Match empty string at begin/end of symbol,
Joe Riel <=