Jakub M.
Jakub M.

Reputation: 33857

Vim regex: why backslash before + and not before *

Is there any particular reason why in vim search patterns "1 or more" is \+ (with backslash) and "zero or more" is * (without backslash)?

Upvotes: 2

Views: 101

Answers (1)

bitmask
bitmask

Reputation: 34644

In comparison to Perl Regular Expressions Vim simply has a couple syntactic differences, which make Vim regular expressions very similar to sed, where you also have to specify the Kleene-Operator with * and the one-or-more variation thereof with \+.

Upvotes: 3

Related Questions