1

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

2

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.

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

Your Answer

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

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