From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Llewelly Newsgroups: gmane.emacs.help Subject: Re: regex support Date: 28 Apr 2005 21:54:24 -0600 Organization: The Illusory Sorting Algorithm Message-ID: <867jimp79r.fsf@zorthluthik.foo.bar> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114746836 21087 80.91.229.2 (29 Apr 2005 03:53:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Apr 2005 03:53:56 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 29 05:53:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DRMZc-0000zu-QL for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Apr 2005 05:53:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DRMfs-0001oz-8N for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Apr 2005 00:00:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!nnrp.xmission!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: llewelly.dsl.xmission.com Original-X-Trace: news.xmission.com 1114746912 2384 166.70.24.138 (29 Apr 2005 03:55:12 GMT) Original-X-Complaints-To: abuse@xmission.com Original-NNTP-Posting-Date: Fri, 29 Apr 2005 03:55:12 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:130559 Original-To: help-gnu-emacs@gnu.org 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:26130 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26130 Ryan Bowman writes: > Does emacs support the regex syntax {4} or any of it's > variants? Yes. See C-h i g (emacs)Regexps However you need to put a backslash before the curly braces: \{4]\} instead of {4} > I'd like to match a date a la 2005-04-19, > so I'm trying (for the year part) something like > "[0-9]{4}", but unless I'm doing something wrong it "[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" should do the trick. Note I used double backslashes (\\) within the string. If your regex isn't in a string literal use single backslash (\) . > doesn't seem to be working. Assuming it doesn't > support that, is there a better way to match an string > of digits of length 4 than "[0-9][0-9][0-9][0-9]"? [snip] hm... "[0-9]\\{4\\}" is fewer chars but "[0-9][0-9][0-9][0-9]" is easier to read ...