[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with re-search-forward under Latest CVS
From: |
Tyler Spivey |
Subject: |
Problems with re-search-forward under Latest CVS |
Date: |
Sun, 02 Nov 2008 19:08:31 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Hello. I've found a strange problem with the way regexes are handled. I've read
the manual, but am still confused. For example, if we evaluate:
(progn
(setq re1 "\377\371")
(setq re2 "\\(\377\371\\)")
(insert (decode-coding-string "line 1\nline 2\377\371" 'raw-text-unix)))
Doing all of the following with point after the sexp with each command produces
the following results:
M-: (re-search-forward re1) - works as expected, puts point after the two
characters at the end of the buffer.
M-: (re-search-forward re2) - search failed. This is what is puzzling me
because from what I've read, the \( and \) are just grouping constructs which
should not effect the outcome of the search in this simple case.
M-x toggle-enable-multibyte-characters RET M-: (re-search-forward re1) - fails.
M-: (re-search-forward re2) - with multibyte disabled, this now works.
Could someone please explain what is happening here? Running multibyte-string-p
on re1 and re2 both say nil, as expected.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Problems with re-search-forward under Latest CVS,
Tyler Spivey <=