From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Tassilo Horn <tsdh@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Use Vertico + consult to do the search for an exact word.
Date: Thu, 1 Jun 2023 17:59:15 +0800 [thread overview]
Message-ID: <CAGP6PO+uGQrhJOy_g4ABEmrSaSoVd_VkoeoQLu2XYsoeeWA14Q@mail.gmail.com> (raw)
In-Reply-To: <87v8g7se5h.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 972 bytes --]
On Thu, Jun 1, 2023 at 5:52 PM Tassilo Horn <tsdh@gnu.org> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> >> I don't use consult myself but I guess the search string is a regular
> >> expression. So when you want to search for an exact word, use \bid\b
> >> to find all occurrences of the word id.
> >
> > I've tried this trick, but it cannot match the results like `$id$', as
> > shown in the attached screenshot, from where you can see that the
> > entry indexed by the circle numbered 1 doesn't appear in the
> > minibuffer's matching list.
>
> That's because $ is a word-character in the syntax-table of the mode you
> are using in that buffer. You can try
> \([^a-zA-Z]\|\b\)id\([^a-zA-Z]\|\b\) which should also find $id$ and
> 1id02.
Yes. This works, as shown in the attached screenshot. But the input is
rather cumbersome. Are there more efficient/concise regexp patterns
for this goal?
> Bye,
> Tassilo
Regards,
Zhao
[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 220060 bytes --]
next prev parent reply other threads:[~2023-06-01 9:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 23:27 Use Vertico + consult to do the search for an exact word Hongyi Zhao
2023-06-01 6:50 ` Tassilo Horn
2023-06-01 7:36 ` Hongyi Zhao
2023-06-01 9:47 ` Tassilo Horn
2023-06-01 9:59 ` Hongyi Zhao [this message]
2023-06-01 18:45 ` Tassilo Horn
2023-06-02 1:53 ` Hongyi Zhao
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=CAGP6PO+uGQrhJOy_g4ABEmrSaSoVd_VkoeoQLu2XYsoeeWA14Q@mail.gmail.com \
--to=hongyi.zhao@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tsdh@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.
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).