Saturday, July 25, 2020

Re: How can I find where one word is close to another word?

On 2020-07-25 17:54, Adrian Keister wrote:
> There's an answer on the Stack Exchange site. Does that method work
> also?

That method finds only the case in which you have "aid" *followed by*
"country", so if you have

"This country needs all good men to come to her aid."

it won't find that even though "country" and "aid" are within 10
words of each other.

You might recognize that it's pretty similar to the first half of my
2nd answer: "term1(N optional words)term2" which I then swap around
with "or term2(N optional words)term1".

So if you only need "X with Y following it within N words", that's
an easy solution. If you need to allow for arbitrary ordering of the
words, you need a bit more such as either of my suggestions.

-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/20200725204142.7d61ace4%40bigbox.attlocal.net.

No comments: