I ran a /.*stem\&.*sun in vim terminal.

It prompted this error without throwing me any search result.

E363: pattern uses more memory than 'maxmempattern'                               
E385: search hit BOTTOM without match for: .*stem\&.*sun

Any solution ?

I am learning to search multiple words in a sentence in vim in any order. I tried:


This works, but i am looking for a more convenient way to do it because eventually I will have to look for way to search for 3 (or more) words in a sentence in any order.

  • You don't have enough memory allocated for a complicated and/or inefficient regex search. See :h 'maxmempattern'. (Searching for the error message would have taken you to the same place: :h E363)
    – B Layer
    May 18 at 10:07
  • I see, It said the search pattern is too complex.. that would meant the ''/.*stem&.*sun'' to search the 2 words in any order in a sentence is totally no no.
    – andrew_ysk
    May 18 at 10:12
  • /(?i)(?:test.*long|long.*test)/ <---this also don't work
    – andrew_ysk
    May 18 at 10:14
  • 1
    :set maxmempattern=5000 i saw this in google.. is that correct ? i just need to change the value . got it changed.
    – andrew_ysk
    May 18 at 10:30
  • 1
    @andrew_ysk If that solve your issue please post an answer and mark it as accepted so that future reader will know it worked for you.
    – statox
    May 18 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.