unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tyler Spivey <tspivey@pcdesk.net>
To: emacs-devel@gnu.org
Subject: Problems with re-search-forward under Latest CVS
Date: Sun, 02 Nov 2008 19:08:31 -0800	[thread overview]
Message-ID: <87ljw1pkuo.fsf@pcdesk.net> (raw)

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.




                 reply	other threads:[~2008-11-03  3:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ljw1pkuo.fsf@pcdesk.net \
    --to=tspivey@pcdesk.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).