From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruno Barbier Newsgroups: gmane.emacs.help Subject: Re: a question about regular expression Date: 28 Sep 2009 09:54:29 GMT Organization: les newsgroups par Orange Message-ID: <4ac087d5$0$12628$ba4acef3@news.orange.fr> References: <83ske8zwkz.fsf@ymail.invalid> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1254166549 26625 80.91.229.12 (28 Sep 2009 19:35:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Sep 2009 19:35:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 28 21:35:42 2009 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.50) id 1MsM0c-0006a3-78 for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Sep 2009 21:35:42 +0200 Original-Received: from localhost ([127.0.0.1]:34815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsM0b-0004cH-An for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Sep 2009 15:35:41 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!goblin2!goblin.stu.neva.ru!feeder.erje.net!newsfeed.straub-nv.de!proxad.net!feeder1-2.proxad.net!193.252.117.184.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.9p1 (Linux) Original-Lines: 25 Original-NNTP-Posting-Date: 28 Sep 2009 11:54:29 CEST Original-NNTP-Posting-Host: 90.26.75.133 Original-X-Trace: 1254131669 news.orange.fr 12628 90.26.75.133:13711 Original-X-Complaints-To: abuse@orange.fr Original-Xref: news.stanford.edu gnu.emacs.help:173385 X-Mailman-Approved-At: Mon, 28 Sep 2009 15:33:45 -0400 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:68517 Archived-At: On 2009-09-27, Water Lin 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.