I am trying to search for numeric values in files. I use / command to start my search (/34587). However I need to add more then one search criteria (i.e. finding value 3487 and 09087 for instance). What is the search command in vim for such scenarios? thank you


There's no "special command" for that. You use just the same / (or ?) but along with a special pattern called "a regular expression".

An introduction to this topic is written in the chapter 27 of Vim User Manual (:h usr_27.txt). Specifically, a section 27.5 "Alternatives" (:h 27.5). So in your case it is /3487\|09087.

  • thank you! works
    – henrietta
    Sep 24 '19 at 18:39
  • 1
    @henrietta A great intro to regular expressions (or regex) in vim is vimregex.com. It helped me a lot when I was first learning regex
    – DJMcMayhem
    Sep 24 '19 at 19:19
  • Might be worth mentioning \d
    – D. Ben Knoble
    Sep 25 '19 at 0:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.