0

Some text file contains lots of hex strings, a same string presents multiple times in two formats like:

00000000 aa bb cc 25 41 f3 d9 ed 58 5c ed a0 3c 61 60 ce ...%A...X..<a`.

and

aabbcc2541f3d9ed585ceda03c6160ce

When I search the string, I have to search twice, first for aa bb cc, and then search for aabbcc. Is it possible to search once, that would highlight both with-space and none-space strings? And press N to jump through these results just like normal search?

1
  • 1
    Have you ever heard of regular expressions?
    – Matt
    Commented Jan 13, 2021 at 12:50

1 Answer 1

2

:help / should get you to :help pattern, from which you can learn all about vim’s syntax for patterns. Since they can used in more places than just /, it’s worth an initial read.

In your case, one option is /\vaa ?bb ?cc

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.