Using Regular Expressions
Regular expressions are used to construct simple to complex search criteria, as described in the following sections. Regular expressions are supported by the
find,
substitute,
caret, and
window ACL commands as well as the
match,
sub and
gsub ACL functions.
There are two ways to use regular expressions in commands. The first is to specify the
-e option as part of your command (see the syntax for the individual command for more information). The second is to use the command
set expressions=
on.
Regular expressions are normally delimited by the / character when used in commands, although you may use any standard command string delimiters. When used as string terms in functions such as match, they must be delimited with the standard string term delimiters " or '. The rules for strings in double quotes apply before the regular expression is parsed: backslash sequences, such as \n (newline) and \t (tab), are replaced by the corresponding character and variable substitution is performed.