[6655] in Athena Bugs
decmips 7.2M: emacs
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri Dec 21 16:50:39 1990
To: bugs@ATHENA.MIT.EDU
Date: Fri, 21 Dec 90 16:50:24 EST
From: Raul Acevedo <acevedo@ATHENA.MIT.EDU>
System name: tailgunner
Type and version: KN01 7.2M
Display type: PM-MONO
What were you trying to do?
---------------------------
Do some regexp matching in emacs lisp.
What's wrong:
-------------
Some of the matches I'm doing seem to depend on the length of the
string being matched. The regexp I'm using is:
(setq zwgc-msg-regexp "\\`\\([^]+\\)_")
Now, try this:
(setq works1 (concat (make-string 100 ?x) "_"))
(string-match zwgc-msg-regexp works1)
=> 0
and that's fine. Doing:
(setq works2 (concat (make-string 1279 ?x) "_"))
(string-match zwgc-msg-regexp works2)
=> 0
and that works also. BUT:
(setq buggy (concat (make-string 1300 ?x) "_"))
(string-match zwgc-msg-regexp buggy)
=> nil
and that's obviously not right; all I did was increment the length of
the string by one.
What should have happened:
--------------------------
`(string-match zwgc-msg-regexp buggy)' should've returned 0. There's no
reason why incrementing the length of the string by one should make a
difference.
Please describe any relevant documentation references:
------------------------------------------------------
Elisp manual, node "Syntax of Regexps".