O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Special regex characters

Let's dig deeper into regex:

Symbol

Meaning

.

Any character, except for end of the line

^

The beginning of the line

$

The end of the line

\_

Any character, including end of the line

\<

The beginning of a word

\>

The end of a word

You can see the full list of these using :help ordinary-atom.

There are also what Vim calls character classes:

Symbol

Meaning

\s

Whitespace (Tab and Space)

\d

A digit

\w

A word character (digits, numbers or underscores)

\l

A lowercase character

\u

An uppercase character

\a

An alphabetic character

 

These classes have the opposite effect when capitalized; for example, \D matches all non-digit characters, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required