From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.help Subject: Re: RE for any text, including white space Date: Wed, 16 Mar 2011 12:40:22 -0700 Message-ID: References: <4D80B9BE.2070105@mousecar.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1300327840 1800 80.91.229.12 (17 Mar 2011 02:10:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2011 02:10:40 +0000 (UTC) Cc: GNU Emacs List To: gebser@mousecar.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 17 03:10:31 2011 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 1Q02fX-0006PG-JJ for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Mar 2011 03:10:31 +0100 Original-Received: from localhost ([127.0.0.1]:59148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q02fW-0006OL-Uu for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Mar 2011 22:10:31 -0400 Original-Received: from [140.186.70.92] (port=35037 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pzwav-00039x-Ib for help-gnu-emacs@gnu.org; Wed, 16 Mar 2011 15:41:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzwaN-0005Ni-Md for help-gnu-emacs@gnu.org; Wed, 16 Mar 2011 15:40:48 -0400 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:51474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzwaN-0005NR-Gz for help-gnu-emacs@gnu.org; Wed, 16 Mar 2011 15:40:47 -0400 Original-Received: by fxm18 with SMTP id 18so2276874fxm.0 for ; Wed, 16 Mar 2011 12:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=4lDcX+SfaLw8wxd9GkD84/cSx2Janhoo3+Lm+gtH6iw=; b=Hgtb4fEPDfbVOpJsWgWK+5xJAlJD3w8xPq89dHjY7q0oBETn0NSEl5nfrmnRPYXnTv RpeA6s5LuxUl8ImPmZ6evokqPVsBhP7e9X7kHNuFawy0m1OqiZDaCM7X/EoQc2r+7pn1 wHusho1tYToftVZQpXn98pBjLFi+4hno/A2UQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=h7yR32Oli0ovVOizMVqem4msjY6ABhjgnbPUz5A4vIsCsc6j5NWIfx2WOKvD105zdd d/l5G8CQgLaZ+Us+XRhFaU/23wPEOCTAbrmExlQxPQVKS0WSCeFc6IOXRH6SgfYPkS6r ecnFHSx1U4ZAaw3ekXyA/10PwEADd3Iso11a0= Original-Received: by 10.223.95.135 with SMTP id d7mr445018fan.65.1300304422781; Wed, 16 Mar 2011 12:40:22 -0700 (PDT) Original-Received: by 10.223.74.12 with HTTP; Wed, 16 Mar 2011 12:40:22 -0700 (PDT) In-Reply-To: <4D80B9BE.2070105@mousecar.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.41 X-Mailman-Approved-At: Wed, 16 Mar 2011 22:07:45 -0400 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:80195 Archived-At: On 3/16/11, ken wrote: > What's the RE for any text, white space included? I also want to grab > (for match-string...) this text. The text is bounded by known > characters. E.g., > >

Any Text-- > Hot Stuff

> > > In the above, how to grab the text of the title, i.e., everything > between

and

? Conceivably this title text might contain > *anything* except " If A and B are your start and end points, then you want: "A\\(.\\|\n\\)*?B" You probably got thrown off by the fact that '.' matches anything EXCEPT a newline. Regexps are usually assumed to be line-based. The '?' is there to make the '*' non-greedy, to prevent it from matching everything between the first A and the last B in the whole buffer. The double '\'s are necessary in lisp code because it's interpreted as a string before it's passed to the regexp engine. -PJ