From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: string searching and saving results to a variable Date: Wed, 16 Feb 2011 11:21:28 +0200 Message-ID: References: <4D5B0901.5080100@mousecar.com> <4D5B74FC.80204@mousecar.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1297848139 8717 80.91.229.12 (16 Feb 2011 09:22:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 16 Feb 2011 09:22:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 16 10:22:14 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 1PpdaQ-0007iS-B5 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Feb 2011 10:22:14 +0100 Original-Received: from localhost ([127.0.0.1]:60358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpdaP-0000ND-QF for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Feb 2011 04:22:13 -0500 Original-Received: from [140.186.70.92] (port=56228 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpdZv-0000N8-CW for help-gnu-emacs@gnu.org; Wed, 16 Feb 2011 04:21:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpdZu-00081g-Jf for help-gnu-emacs@gnu.org; Wed, 16 Feb 2011 04:21:43 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:42279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpdZu-00081S-E5 for help-gnu-emacs@gnu.org; Wed, 16 Feb 2011 04:21:42 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PpdZq-0007LY-Ut for help-gnu-emacs@gnu.org; Wed, 16 Feb 2011 10:21:38 +0100 Original-Received: from 91.193.68.214 ([91.193.68.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Feb 2011 10:21:37 +0100 Original-Received: from gavenko by 91.193.68.214 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Feb 2011 10:21:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 14 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91.193.68.214 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: <4D5B74FC.80204@mousecar.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:79138 Archived-At: On 16.02.2011 8:55, ken wrote: > I'm guessing it could then be done more elispishly as > > (setq dog (buffer-substring > (re-search-backward " (re-search-forward "\\|\\|\\|\\|" nil t))) > How about if search fail? Evaluating of (buffer-substring nil nil) take (wrong-type-argument integer-or-marker-p nil).