Next: File Types and Permissions
Up: Filename Patterns (Regular Expressions)
Previous: Play SafeUse echo
One common set of UNIX utilities is that of
grep/egrep/fgrep.
Grep (Get Regular Expression and Print) uses something
called basic regular expressions,
egrep (Extended GREP) uses extended regular
expressions and fgrep just looks for fixed strings.
In the regular expression languages involved with these
utilities (excepting fgrep), there are special symbols which
represent:
- alphanumeric characters,
- alphabetic characters,
- control characters,
- numeric characters,
- graphic characters,
- lowercase letters,
- printable characters,
- punctuation characters,
- space characters,
- uppercase letters and
- hexadecimal (base 16) digits.
The negation (or inversion) operator for a list is not the
``!'', but rather the ``^ ''.
The any single character match moves from ``?'' to ``.''.
These regular expression languages also have special
characters to represent the beginning or end of lines or
words, ways of specifying how few or many (or both - a range
in other words) of a match are allowed, choices between one
pattern OR another.
Another regular expression language family belongs to the
editors: ex/ed/vi.
Other regular expression languages are found in languages
such as awk, perl, ....
The power behind the perl regular expression language is one
reason for its use in CGI scripts, and the world wide web.
Next: File Types and Permissions
Up: Filename Patterns (Regular Expressions)
Previous: Play SafeUse echo
Gordon Haverland
Sat Oct 9 13:50:48 MDT 1999