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

1 Answer 1


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
    Commented Sep 24, 2019 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
    Commented Sep 24, 2019 at 19:19
  • Might be worth mentioning \d
    – D. Ben Knoble
    Commented Sep 25, 2019 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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