help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does word under cursor match pattern?


From: Marc Mientki
Subject: Re: Does word under cursor match pattern?
Date: Wed, 08 Dec 2010 15:25:54 -0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

Am 23.08.2010 13:18, schrieb Paulo J. Matos:
Hi,

I am trying to know if a word under the cursor matched a pattern
([Bb]-?[0-9]+).

Any tips on how to do this?

This is a job for looking-at.

,----[ C-h f looking-at RET ]
| looking-at is a built-in function in `C source code'.
|
| (looking-at REGEXP)
|
| Return t if text after point matches regular expression REGEXP.
| This function modifies the match data that `match-beginning',
| `match-end' and `match-data' access; save and restore the match
| data if you want to preserve them.
`----

regards
Marc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]