I have been looking online for an answer for weeks now, but I am still at a loss... (I didn't learn much from syntax highlighting, and can't find any way to make \._ exclude a match)

I have a file being edited in VIM containing multi-line records - essentially paragraphs separated by "\n\n X", where X may be different characters.

I need, inside vim, to find all records which contain all sought words (and highlight sought words), possibly when those words are search patterns themselves.

This could be put also this way: How do I tell vim to find results of a multi-line search pattern, where such results are not to contain sequence \n\n [a-Z.,+*$#@!] (because such sequence separates the sought records and never appears inside them).


edit#1: To better explain, I am adding 5 samples of records, between each record is : \n\n\s_\s\d+ (where \s is 0x20 and _ is one of several possible ascii chars) :
* 110000000018BBRT Phasellus aliquet blandit tellus, sed sollicitudin augue accumsan vel.

 + 978000220019KML  Mauris et hendrerit dolor, a dapibus ante.
  * Vestibulum viverra ultricies urna.

 ! 020007005289KML  Vestibulum a malesuada enim.
Cras a efficitur est.
Suspendisse in nulla a justo finibus tincidunt.

 x 949317999999BTVN Sed facilisis massa eget mattis feugiat.
  o Interdum et malesuada fames ac ante ipsum primis in faucibus.

 v 949317999999BTV  Vestibulum at lectus at neque malesuada venenatis.

edit#2: I'm new to SE, and I've actually asked this question twice, once here and once there where Ingo Karkat has suggested something that seems to me quite complex (but so far it works, albeit s.l.o.w.l.y), plz forgive me for double-posting ;( ...

  • Welcome to Vi.se! I think I understand what you're asking for, but I can't tell for sure. Could you provide an example? – DJMcMayhem Dec 11 '18 at 21:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.