Skip to Main Content
Regular Expression Pocket Reference, 2nd Edition
book

Regular Expression Pocket Reference, 2nd Edition

by Tony Stubblebine
July 2007
Intermediate to advanced content levelIntermediate to advanced
128 pages
2h 39m
English
O'Reilly Media, Inc.
Content preview from Regular Expression Pocket Reference, 2nd Edition

Supported Metacharacters

Table 56 through Table 60 list the metacharacters and metasequences supported by vi. For expanded definitions of each metacharacter, see "Regex Metacharacters, Modes, and Constructs.”

Table 1-56. vi character representation

Sequence

Meaning

Vim only

 

\b

Backspace, \x08.

\e

Escape character, \x1B.

\n

Newline, \x0A.

\r

Carriage return, \x0D.

\t

Horizontal tab, \x09.

Table 1-57. vi character classes and class-like constructs

Class

Meaning

[...]

Any character listed, or contained within a listed range.

[^...]

Any character that is not listed, or contained within a listed range.

[:class:]

POSIX-style character class (valid only within a character class).

.

Any character except newline (unless /s mode).

Vim only

 

\w

Word character, [a-zA-z0-9_].

\W

Nonword character, [^a-zA-z0-9_].

\a

Letter character, [a-zA-z].

\A

Nonletter character, [^a-zA-z].

\h

Head of word character, [a-zA-z_].

\H

Not the head of a word character, [^a-zA-z_].

\d

Digit character, [0-9].

\D

Nondigit character, [^0-9].

\s

Whitespace character, [ \t].

\S

Nonwhitespace character, [^ \t].

\x

Hex digit, [a-fA-F0-9].

\X

Nonhex digit, [^a-fA-F0-9].

\o

Octal digit, [0-7].

\O

Nonoctal digit, [^0-7].

\l

Lowercase letter, [a-z].

\L

Nonlowercase letter, [^a-z].

\u

Uppercase letter, [A-Z].

\U

Nonuppercase letter, [^A-Z].

\i

Identifier character defined by isident.

\I

Any nondigit identifier character.

\k

Keyword character defined by iskeyword, often set by language modes.

\K

Any nondigit keyword character.

\f

Filename character defined by isfname. Operating system-dependent. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PHP Advanced for the World Wide Web: Visual QuickPro Guide

PHP Advanced for the World Wide Web: Visual QuickPro Guide

Larry Ullman
PHP 5 Power Programming

PHP 5 Power Programming

Andi Gutmans, Stig Sæther Bakken, Derick Rethans

Publisher Resources

ISBN: 9780596514273Errata Page