From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Visher Newsgroups: gmane.emacs.help Subject: Re: Regex to match "define ABC-123-xyz" Date: Fri, 1 Oct 2010 08:58:23 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285937959 26795 80.91.229.12 (1 Oct 2010 12:59:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Oct 2010 12:59:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 01 14:59:17 2010 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.69) (envelope-from ) id 1P1fCj-0001yy-Li for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Oct 2010 14:59:13 +0200 Original-Received: from localhost ([127.0.0.1]:48899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1fCj-0002uA-7L for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Oct 2010 08:59:13 -0400 Original-Received: from [140.186.70.92] (port=51888 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1fCK-0002t6-47 for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 08:58:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P1fCI-0003Rg-IY for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 08:58:47 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:59384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P1fCI-0003RJ-DC for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 08:58:46 -0400 Original-Received: by wyb36 with SMTP id 36so3781410wyb.0 for ; Fri, 01 Oct 2010 05:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=WgeRItiHp3nWZWMM1HsD1mtQWNRUDtbbe7dUKYZEDSk=; b=qaecdGjqT2uo/RiZMvEsWaAm+xrfJ2TE5CEL3eeMta2VPrnnVqxFFCiWrCoReyuTYX 3kxw5PtnCPF/GyKrNY3+hgEm2l+FSCXNxg6Nd+l8M4SZiSS3/sVUWk42r913xONNb/2Y 2Gow5Ci/n3+6OxSMF5LmP6JYKW1RZV9416Rcc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=thRrmJ5DP2B9Tz7zWxs3DiIIn6X5zMD53ewr3Dd5Jxd24eEzTCqWxUhbtRwqZIhCcD AHYzYhtKarktfX1Daa50Hpk/3APBt2fz7tqh7MW4CMa5q2e4JJdVqi44BM6tVr+wTIdx FSXe/ODk0ea3JmnrEjbPOs9IKERQHD18+CPA0= Original-Received: by 10.227.72.200 with SMTP id n8mr4242856wbj.223.1285937924006; Fri, 01 Oct 2010 05:58:44 -0700 (PDT) Original-Received: by 10.227.155.129 with HTTP; Fri, 1 Oct 2010 05:58:23 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:75051 Archived-At: Hi Gary, On Fri, Oct 1, 2010 at 8:10 AM, Gary wrote= : > I'm having trouble with this, to say the least. "Obviously" the parts > after the define aren't fixed, either in content or position. What I > have tried is > > define [A-Za-z0-9_-]+ > > (that is, match the string "define", followed by a single space, > followed by some string consisting of letters and numbers plus "_" and > "-") which works except... it doesn't match the numeric part(s). I can > see this in the regexp builder, and, since I am attempting to match part > of a programming language syntax, in source code. Kind of > confusing. What have I done wrong, please? Don't really understand what's going on. I type the following into scratch and use `M-x regex-builder` and it works exactly as I believe you want it to. *scratch* contents define thisIs01Test_with-all_validChars0001 *RE-Builder* contents define [A-Za-z0-9_-]+ Full match=E2=80=A6 Could you provide an actual example of a string you're trying to match that it isn't matching? -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail