all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Visher <tim.visher@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Regex to match "define ABC-123-xyz"
Date: Fri, 1 Oct 2010 08:58:23 -0400	[thread overview]
Message-ID: <AANLkTi=-mC1n0QTiiNeoaLPnwCsZfO-16MD7hLkBqhEH@mail.gmail.com> (raw)
In-Reply-To: <i84j3s$abl$1@dough.gmane.org>

Hi Gary,

On Fri, Oct 1, 2010 at 8:10 AM, Gary <help-gnu-emacs@garydjones.name> 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…

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



  parent reply	other threads:[~2010-10-01 12:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01 12:10 Regex to match "define ABC-123-xyz" Gary
2010-10-01 12:18 ` Deniz Dogan
2010-10-01 13:45   ` Gary
2010-10-01 15:23     ` rasmith
2010-10-05  6:47       ` Gary
2010-10-01 12:48 ` Tyler Smith
2010-10-01 13:42   ` Gary
2010-10-01 12:58 ` Tim Visher [this message]
2010-10-01 13:59   ` Erik L. Arneson
     [not found]   ` <mailman.4.1285942809.2643.help-gnu-emacs@gnu.org>
2010-10-01 16:04     ` rustom
     [not found] <mailman.0.1285935054.30433.help-gnu-emacs@gnu.org>
2010-10-01 12:20 ` Marc Mientki
2010-10-01 12:26 ` David Kastrup

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='AANLkTi=-mC1n0QTiiNeoaLPnwCsZfO-16MD7hLkBqhEH@mail.gmail.com' \
    --to=tim.visher@gmail.com \
    --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.