next next up down toc toc mail

9.8.  The UNIX Extensions to Regular Expressions

The UNIX OS has several commands that use regular expressions.

--   editors (vi, emacs)
--   grep and cousins
--   lex
Unix commands deal with single lines of text. The Unix regular expressions notation includes special symbols that denote the beginning and end of a line.
^   beginning of of a line
$   ending of of a line

The character ``.'' in Unix regular expressions stands for any character.

A quick overview of Unix regular expressions

Reg-expr    Description
----------------------------------------------------------------------
.           the wild card symbol matches any character except newline
[a-z0-9]    Matches any single character of the set
[^a-z0-9]   Matches any single character not in set
x?          Matches 0 or 1 x's, where x is any of the above
x*          Matches 0 or more x's
cia|mi5     Matches one of cia or mi5
(x)         Brackets a regular expression


back next up down toc toc mail


Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1998).

Last modified: 27/July/98 (12:14)