From: Tom <adatgyujto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Numbered regexps throw invalid regex error
Date: Wed, 25 Jan 2012 17:51:43 +0000 (UTC) [thread overview]
Message-ID: <loom.20120125T184906-790@post.gmane.org> (raw)
In-Reply-To: 4F203A13.20105@easy-emacs.de
Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>
> Am 25.01.2012 11:17, schrieb Tom:
> > (looking-at "\\(a\\(?1:b\\)\\)")
> >
> AFAIU there are serveral errors,
>
> think you can't refer to first match inside itself
>
You misunderstand the feature.
It's not a backreference. It's an explicit numbering of
the group, so it doesn't change if you add more parens:
`\(?NUM: ... \)'
is the "explicitly numbered group" construct. Normal groups get
their number implicitly, based on their position, which can be
inconvenient. This construct allows you to force a particular
group number. There is no particular restriction on the numbering,
e.g. you can have several groups with the same number in which case
the last one to match (i.e. the rightmost match) will win.
Implicitly numbered groups always get the smallest integer larger
than the one of any previous group.
next prev parent reply other threads:[~2012-01-25 17:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-25 10:17 Numbered regexps throw invalid regex error Tom
2012-01-25 17:21 ` Andreas Röhler
2012-01-25 17:51 ` Tom [this message]
2012-01-25 20:02 ` Andreas Röhler
2012-01-25 20:14 ` Tom
2012-01-25 20:37 ` Andreas Röhler
2012-01-26 8:30 ` Tom
2012-01-26 9:29 ` Andreas Röhler
2012-01-26 11:52 ` Tim Landscheidt
2012-01-26 14:36 ` Tom
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=loom.20120125T184906-790@post.gmane.org \
--to=adatgyujto@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.