all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marc Mientki <mientki@nonet.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Does word under cursor match pattern?
Date: Mon, 23 Aug 2010 13:58:39 +0200	[thread overview]
Message-ID: <i4tnpe$mpe$1@news.onet.pl> (raw)
In-Reply-To: <mailman.6.1282562668.29657.help-gnu-emacs@gnu.org>

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	other threads:[~2010-08-23 11:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6.1282562668.29657.help-gnu-emacs@gnu.org>
2010-08-23 11:58 ` Marc Mientki [this message]
2010-08-23 11:18 Does word under cursor match pattern? Paulo J. Matos
2010-08-23 11:56 ` Lennart Borgman
2010-08-23 12:43   ` Paulo J. Matos
2010-08-23 12:37 ` Deniz Dogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='i4tnpe$mpe$1@news.onet.pl' \
    --to=mientki@nonet.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.