On Thu, Jun 1, 2023 at 5:52 PM Tassilo Horn wrote: > > Hongyi Zhao 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