From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Hanchrow Newsgroups: gmane.emacs.help Subject: Re: Regexp to find second of three words Date: Mon, 07 Aug 2006 10:27:58 -0700 Message-ID: <87psfcv4kh.fsf@offby1.atm01.sea.blarg.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1154972330 12429 80.91.229.2 (7 Aug 2006 17:38:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2006 17:38:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 07 19:38:49 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GA93j-0003bq-IH for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Aug 2006 19:38:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GA93i-000802-U0 for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Aug 2006 13:38:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GA93W-0007zO-8X for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 13:38:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GA93U-0007z3-VX for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 13:38:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GA93U-0007z0-Pi for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 13:38:20 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GA97m-0003Wv-4x for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 13:42:46 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GA93K-0003Xt-5E for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 19:38:10 +0200 Original-Received: from q-static-138-125.avvanta.com ([206.124.138.125]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Aug 2006 19:38:10 +0200 Original-Received: from offby1 by q-static-138-125.avvanta.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Aug 2006 19:38:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 19 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: q-static-138-125.avvanta.com User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.51 (gnu/linux) Cancel-Lock: sha1:J54wCiLQ4E7W7p4LHj4/PZXxVB0= 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:36557 Archived-At: I probably misunderstand what you're trying to do with the stuff that begins with \\(d\\(?:ef, but I imagine you'll be able to correct what I've got. (let ((p (rx "set" (one-or-more space) "'" (group (one-or-more (or alnum (any "*-_.")))) (one-or-more space) (or "def" "does" "func" "function" "has" "lfinc" "sub"))) (input "set 'printf function")) (string-match p input) (match-string 1 input)) -- Rarely do we find men who willingly engage in hard, solid thinking. There is an almost universal quest for easy answers and half-baked solutions. Nothing pains some people more than having to think. -- Martin Luther King, Jr. from "Strength to Love," 1963.