From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: Problem with re-search-backward and "\\=" Date: Wed, 17 Sep 2003 10:39:23 -0700 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <3459kb.h6.ln@acm.acm> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: sea.gmane.org 1063820484 7291 80.91.224.253 (17 Sep 2003 17:41:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 Sep 2003 17:41:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 17 19:41:22 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19zgIs-0002vU-00 for ; Wed, 17 Sep 2003 19:41:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19zgIM-0003Jk-Nv for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Sep 2003 13:40:50 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19zgIA-0003JI-Ig for help-gnu-emacs@gnu.org; Wed, 17 Sep 2003 13:40:38 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19zgI9-0003J2-3a for help-gnu-emacs@gnu.org; Wed, 17 Sep 2003 13:40:37 -0400 Original-Received: from [153.105.4.30] (helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.22) id 19zgI8-0003Ip-LG for help-gnu-emacs@gnu.org; Wed, 17 Sep 2003 13:40:36 -0400 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id KAA10621 for ; Wed, 17 Sep 2003 10:42:25 -0700 Original-Received: from [198.17.100.22] (G_Hill_Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.12.8/8.12.8) with ESMTP id h8HHf0DF002193 for ; Wed, 17 Sep 2003 10:41:00 -0700 In-Reply-To: <3459kb.h6.ln@acm.acm> Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12594 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12594 At 8:13 AM +0000 9/17/03, Alan Mackenzie wrote: >OK, I think I've got it now. It finds the _minimum_ match it can. Well, not exactly. It finds the longest "rightmost" match it can. Searching backward, once it has found a character that can serve as the beginning of a complete match, it then still finds the longest match possible starting from that point. For example, starting with (point) just in front of the "b" in "fooooo gooo bar", (re-search-backward "[fg]o*" nil t) will find and return "gooo", not just "go", as the string returned by (match-string 0). >For what I actually need to do (moving back any >combination of whitespace and a few things like "//." as the first >non-space stuff on a line), I can do it easily enough by hand. It sounds to me like the functions skip-chars-forward, skip-chars-backward, skip-syntax-forward and skip-syntax-backward will probably serve you well. --Greg