O'Reilly logo

VBScript Pocket Reference by Matt Childs, Paul Lomax, Ron Petrusha

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

Chapter 3. Regular Expression Characters Reference

Symbol

Description

\

Marks the next character either as a special character (such as \n for the newline character) or as a literal (if that character otherwise has special meaning in a pattern search string). The special characters are:

 

\f Form feed character

 

\n Newline character

 

\r Carriage return character

 

\t Tab character

 

\v Vertical tab character

^

Matches the beginning of input.

$

Matches the end of input.

*

Matches the preceding character zero or more times.

+

Matches the preceding character one or more times.

?

Matches the preceding character zero or one time.

.

Matches any single character except a newline character.

( )

Defines a subexpression within the larger subexpression. A subexpression:

  • Overrides the order of precedence used in evaluating pattern strings.

  • Can be referenced again in the pattern string. To insert the result of the subexpression later in the pattern string, reference it by its one-based ordinal position among subexpressions, preceded by the backslash symbol (e.g., \1).

  • Can be referenced again in the replacement string in calls to the RegExp.Replace method. To use the result of the original subexpression as a replacement string, reference its one-based ordinal position among subexpressions, preceded by a dollar sign (e.g., $1).

x|y

Matches either x or y.

{n}

Matches exactly n times, where n is a non-negative integer.

{n,}

Matches at least n times, where n is a non-negative integer. o{1,} is the same as o+, and o{0,} is the same ...

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