From: Douglas Lewan <d.lewan2000@gmail.com>
To: Teemu Likonen <tlikonen@iki.fi>, help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Regular expression grouping not working?
Date: Sat, 8 Feb 2020 14:48:26 -0500 [thread overview]
Message-ID: <839ed1f6-9c0e-f6c7-082b-8398c5861de9@gmail.com> (raw)
In-Reply-To: <871rr4op14.fsf@iki.fi>
On 2/8/20 2:30 PM, Teemu Likonen wrote:
> Douglas Lewan [2020-02-08T14:17:54-05] wrote:
>
>> I'm writing some code that includes the regular expression \\([^/]+/\\),
>> (looking for a path on GNU/Linux) which doesn't match what I expect it
>> should.
> Maybe your backslash escaping is wrong. In regular expressions the
> grouping is made with \( \) but within Lisp strings backslash has a
> special meaning too and those must be escaped "\\( \\)".
Damn! I was passing the double slash to a command I use to help me debug
regular expressions.
Hand it the right string and it matches just as expected. (Too much
kill-and-yank.)
Maybe now I can track down the real bug.
Thanks for helping me change my perspective.
>> Is there something I'm missing?
> I think we need more information about your code and input data.
--
,Doug
d.lewan2000@gmail.com
(908) 720 7908
Isn't there a difference between "acquittal" and "exoneration"?
next prev parent reply other threads:[~2020-02-08 19:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-08 19:17 Regular expression grouping not working? Douglas Lewan
2020-02-08 19:30 ` Teemu Likonen
2020-02-08 19:48 ` Douglas Lewan [this message]
2020-02-17 0:15 ` Göktuğ Kayaalp
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=839ed1f6-9c0e-f6c7-082b-8398c5861de9@gmail.com \
--to=d.lewan2000@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tlikonen@iki.fi \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).