UNIX Regular Expressions

Regular Expression Syntax

This section provides lists of the UNIX, SlickEdit® , and Brief regular expression syntaxes, samples, and Unicode category specifications.

UNIX Regular Expressions

UNIX regular expressions are defined in the following table.

Table 11.12. UNIX Regular Expression

UNIX Regular Expression

Definition

 

 

^

Matches beginning of line.

 

 

$

Matches end of line.

 

 

.

Matches any character except newline.

 

 

X+

Maximal match of one or more occurrences of X.

 

See Minimal versus Maximal Matching.

 

 

X*

Maximal match of zero or more occurrences of X.

X?

Maximal match of zero or one occurrences of X.

 

 

X{n1}

Match exactly n1 occurrences of X.

 

 

X{n1,}

Maximal match of at least n1 occurrences of X.

 

 

X{,n2}

Maximal match of at least zero occurrences but not

 

more than n2 occurrences of X.

X{n1,n2}

Maximal match of at least n1 occurrences but not

 

more than n2 occurrences of X.

X+?

Minimal match of one or more occurrences of X.

 

 

X*?

Minimal match of zero or more occurrences of X.

X??

Minimal match of zero or one occurrences of X.

 

 

X{n1}?

Matches exactly n1 occurrences of X.

 

 

 

 

520

Page 542
Image 542
Slick V3.3 manual Regular Expression Syntax, Unix Regular Expressions