From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.help Subject: Re: Why does this happen in regexp isearch? Date: Sat, 03 Jul 2010 23:14:59 +1000 Message-ID: <87sk40g10s.fsf@rimspace.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1278163117 15098 80.91.229.12 (3 Jul 2010 13:18:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Jul 2010 13:18:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 03 15:18:36 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OV2c8-00083W-3t for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Jul 2010 15:18:36 +0200 Original-Received: from localhost ([127.0.0.1]:54673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OV2c7-0006zn-HD for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Jul 2010 09:18:35 -0400 Original-Received: from [140.186.70.92] (port=57711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OV2bg-0006zf-71 for help-gnu-emacs@gnu.org; Sat, 03 Jul 2010 09:18:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OV2be-0008TK-NK for help-gnu-emacs@gnu.org; Sat, 03 Jul 2010 09:18:08 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:38015) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OV2be-0008SM-Ht for help-gnu-emacs@gnu.org; Sat, 03 Jul 2010 09:18:06 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OV2bZ-0007n0-4Y for help-gnu-emacs@gnu.org; Sat, 03 Jul 2010 15:18:01 +0200 Original-Received: from ppp59-167-189-244.static.internode.on.net ([59.167.189.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Jul 2010 15:18:01 +0200 Original-Received: from daniel by ppp59-167-189-244.static.internode.on.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Jul 2010 15:18:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ppp59-167-189-244.static.internode.on.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:SStHk6veH5vjlqbMAmOvgkWDOOw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74058 Archived-At: Deniz Dogan writes: > I open cus-edit.el.gz in Emacs and do a regexp isearch for: > > ^ ;; > > (Beginning of line, then two spaces, then two semicolons.) > > For some reason that I don't understand, it seems to match "beginning > of line, any number of spaces OR tabs, then two semicolons". When I > search for: > > ^ \{2\};; > > ...it finds what I'm looking for. Why is this? (defcustom search-whitespace-regexp (purecopy "\\s-+") "If non-nil, regular expression to match a sequence of whitespace chars. This applies to regular expression incremental search. When you put a space or spaces in the incremental regexp, it stands for this, unless it is inside of a regexp construct such as [...] or *, + or ?. You might want to use something like \"[ \\t\\r\\n]+\" instead. In the Customization buffer, that is `[' followed by a space, a tab, a carriage return (control-M), a newline, and `]+'. When this is nil, each space you type matches literally, against one space." :type '(choice (const :tag "Find Spaces Literally" nil) regexp) :group 'isearch) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons