Thursday, October 3, 2024

Re: Finding all words

On 2024-10-03 15:09, Mikhail Velikikh wrote:
> > Is there a way to compose a regular expression in Vim that will find all
> > the words I want, irrespective of the order in which they occur?
>
> I would use something like this:
> \v<(quick|brown|lazy|jumps)>

That finds *any* of the words, not *all* of the words as the OP requested.

While the implementation can often end up slow if you have a large
text or lots of find-them-all terms, you (OP) can use

:help /\&

to join the conditions like

/.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps/

-tim





--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/Zv6nnfKqWolaBkMm%40thechases.com.

No comments:

Post a Comment