From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Re: Regex to match "define ABC-123-xyz" Date: Fri, 1 Oct 2010 14:18:35 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1285938458 29197 80.91.229.12 (1 Oct 2010 13:07:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Oct 2010 13:07:38 +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 15:07:36 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 1P1fKq-0004rL-AV for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Oct 2010 15:07:36 +0200 Original-Received: from localhost ([127.0.0.1]:37308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1fKp-0005AZ-IY for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Oct 2010 09:07:35 -0400 Original-Received: from [140.186.70.92] (port=49019 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1eb3-0002IS-9n for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 08:21:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P1eZv-0008M3-BQ for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 08:20:16 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:59077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P1eZv-0008Ls-88 for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 08:19:07 -0400 Original-Received: by iwn33 with SMTP id 33so5842898iwn.0 for ; Fri, 01 Oct 2010 05:19:06 -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; bh=XsWkYUQPgx5uDgI4ERlmJqwF1FqfUe38KXIRQZUMrNg=; b=UKUDSaxqwl6ap/2nWXyIuMRyla7hLPB3PJC1EXXI3zEZNo3p468nD8xoYSdgmWkoTy ltdZ0KkTK2kirUzMV9qRE19VQHkQFEdeqyZf89+4oogaVZSfcN7FTseUv2BuRL6mI5BB A8Y+w7mUSqp1NIlM4qEcnVP8WD87QKbQb63VU= 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; b=WynGr5XBjJshTo8ZZlyVCBCrZRqDXXk+Bi4chf/1ifH5Or59L5WndHximb2nRV4uy6 OLRuZN/jA6qZcBXU55aE1uCplkMb1GtIS3N+KnVZHeRNVrxrsls1Cx2UcBit29QLcwSi g9J0Z+Sk1fpZ2X9LbDtn7ZnKgqeUPRb1CmHbY= Original-Received: by 10.231.169.149 with SMTP id z21mr5624757iby.11.1285935546199; Fri, 01 Oct 2010 05:19:06 -0700 (PDT) Original-Received: by 10.231.17.66 with HTTP; Fri, 1 Oct 2010 05:18:35 -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:75052 Archived-At: 2010/10/1 Gary : > 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? > Pardon me if I misunderstood, but it works perfectly fine for me in re-builder. Are you saying it works for you in re-builder but not when actually using it in code? -- Deniz Dogan