all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Barbier <bruno.barbier.cs@begin_dom.orange.fr.end_dom>
To: help-gnu-emacs@gnu.org
Subject: Re: a question about regular expression
Date: 28 Sep 2009 09:54:29 GMT	[thread overview]
Message-ID: <4ac087d5$0$12628$ba4acef3@news.orange.fr> (raw)
In-Reply-To: 83ske8zwkz.fsf@ymail.invalid

On 2009-09-27, Water Lin <WaterLin@ymail.invalid> wrote:
>
> Here is my code:
> ---------------
> (defun copy-word (&optional arg)
>  "Copy words at point"
>  (interactive "P")
>  (let ((beg (progn (if (looking-back "[_a-zA-Z0-9]" 1)
>                               (backward-word 1)) (point))) 
> 	(end (progn (forward-word arg) (point))))
>  (copy-region-as-kill beg end))
> )
> ---------------
>
> I want use M-x copy-word to copy a word even the word is combined by _
> . But I don't know why my regular expression doesn't work.
>
> Not every familiar with elisp, sorry for this stupid question.
>

I use:
 
    M-x re-builder

to build interactively my regular expressions and see what they match.


       reply	other threads:[~2009-09-28  9:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83ske8zwkz.fsf@ymail.invalid>
2009-09-28  9:54 ` Bruno Barbier [this message]
2009-09-30 12:43   ` a question about regular expression tomas

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='4ac087d5$0$12628$ba4acef3@news.orange.fr' \
    --to=bruno.barbier.cs@begin_dom.orange.fr.end_dom \
    --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.