From: Samvid Mistry <mistrysamvid@gmail.com>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Regex matching summary blocks in C#
Date: Sun, 03 Dec 2023 20:26:51 +0530 [thread overview]
Message-ID: <m2ttozs51w.fsf@gmail.com> (raw)
In-Reply-To: <CAP_d_8U07ZD3gRc0V_MGABCopKJQYXpn4dkvu8462zbjuHXViA@mail.gmail.com>
Yuri Khan <yuri.v.khan@gmail.com> writes:
> On Sun, 3 Dec 2023 at 21:23, Samvid Mistry <mistrysamvid@gmail.com> wrote:
>
>> > \\(\\(?:.*\n\\)*?\\)
>>
>> IIUC, you are suggesting I do this
>>
>> "\\(\\s-*\\)///\\s-*<summary>\\s-*\n\\(\\(:?.*\n\\)*?\\)\\s-*///\\s-*</summary>"
>
> \\(?:, not \\(:? . The former marks the group as non-capturing. The
> latter introduces a capturing group starting with a colon.
That was my bad. Your expression seems to have worked. Thanks!
Would you mind expaining a bit about why it works? Per my current
understanding, both mine and yours should have the same net effect,
except that marking the inner group non-capturing should make the regex
evaluation a bit faster because emacs need not remember the matched
text. But clearly, my understanding isn't correct.
--
Thanks,
Samvid
next prev parent reply other threads:[~2023-12-03 14:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-03 12:07 Regex matching summary blocks in C# Samvid Mistry
2023-12-03 13:39 ` Yuri Khan
2023-12-03 14:19 ` Samvid Mistry
2023-12-03 14:30 ` Yuri Khan
2023-12-03 14:56 ` Samvid Mistry [this message]
2023-12-03 15:15 ` tomas
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=m2ttozs51w.fsf@gmail.com \
--to=mistrysamvid@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=yuri.v.khan@gmail.com \
/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.