Re: Finding all words

Tim Chase <[email protected]>
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
On 2024-10-03 11:58, Salman Halim wrote:
> >     /.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps/

> something that does the combination thing I was suggesting and time the two
> approaches, but with more than just two words: /quick.*brown\|brown.*quick/
> vs. /.\{-}quick\&.\{-}brown}/

At the cost of some redundancy, you might be able to speed it up a
little bit by requiring that it start with at least one of the words
like

  /\%(\<\%(quick\|brown\|lazy\|jumps\)\>\)\@=\%(.\{-}quick\&.\{-}brown\&.\{-}lazy\&.\{-}jumps\)/

so it won't start looking for the other terms until it's found at
least one of them, cutting out a lot of non-starter cases.

-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 [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/Zv7Bt-O8KlBggCtX%40thechases.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.