unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problems with re-search-forward under Latest CVS
@ 2008-11-03  3:08 Tyler Spivey
  0 siblings, 0 replies; only message in thread
From: Tyler Spivey @ 2008-11-03  3:08 UTC (permalink / raw)
  To: emacs-devel

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.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-03  3:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-03  3:08 Problems with re-search-forward under Latest CVS Tyler Spivey

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).