[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does word under cursor match pattern?
From: |
Deniz Dogan |
Subject: |
Re: Does word under cursor match pattern? |
Date: |
Mon, 23 Aug 2010 14:37:46 +0200 |
2010/8/23 Paulo J. Matos <pocmatos@gmail.com>:
> 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