From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Re: Does word under cursor match pattern? Date: Mon, 23 Aug 2010 14:37:46 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1282567948 22234 80.91.229.12 (23 Aug 2010 12:52:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Aug 2010 12:52:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Paulo J. Matos" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 23 14:52:24 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 1OnWVj-0003Dx-3F for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Aug 2010 14:52:23 +0200 Original-Received: from localhost ([127.0.0.1]:34769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnWVi-0001uJ-8n for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Aug 2010 08:52:22 -0400 Original-Received: from [140.186.70.92] (port=53527 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnWSA-0008P2-D4 for help-gnu-emacs@gnu.org; Mon, 23 Aug 2010 08:48:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnWI7-0000fb-72 for help-gnu-emacs@gnu.org; Mon, 23 Aug 2010 08:38:20 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:63705) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnWI7-0000fQ-4m for help-gnu-emacs@gnu.org; Mon, 23 Aug 2010 08:38:19 -0400 Original-Received: by ywo7 with SMTP id 7so2554150ywo.0 for ; Mon, 23 Aug 2010 05:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=zZUvtW83P+7sd+pa3RXiB0/QMtI7230lkAqc30HLSC4=; b=xT88rBZq/ZxRaWUOiHuWS0G78q8em9rOQL7jWTBQlTxnzRt7kKVpcwmy0G05ujw6W0 58eto2YrCewNGQ1pZzx62h6X25os7CSXf7qNHTVAc18yn7WHBEqnejRplyf4AknmI7Ru PQcJQnXFyzxCC+f+7VA4CyOiu0gVwLgO6GBlo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=HRbkBW5JfBIQ6/QaQT513QB0aStjHH2ocAqLT5G7DbU2XJ/1lkvxA+uYP6VAqQC3dF BHuAId0kU8ihHFHop47fZShedPaCof8eKP4rpI12KJ04dDTm20aUMmEW0hGWIqQEigsN 85K2SjRAULfWg/6RJul0YcjNFYe9omvRPcsgE= Original-Received: by 10.150.69.34 with SMTP id r34mr4793982yba.385.1282567098202; Mon, 23 Aug 2010 05:38:18 -0700 (PDT) Original-Received: by 10.220.200.195 with HTTP; Mon, 23 Aug 2010 05:37:46 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:74773 Archived-At: 2010/8/23 Paulo J. Matos : > Hi, > > I am trying to know if a word under the cursor matched a pattern > ([Bb]-?[0-9]+). My idea was: > - Select region with word under cursor > - Transform region into string > - Apply regexp on string > > This has one problem: I can't seem to find a function to transform a > region into a string. On the other hand maybe I can work with the region > directly. > > Any tips on how to do this? > You can use e.g. (thing-at-point 'word). This would return the string with properties and such, if you want that. -- Deniz Dogan