This document describes the regular expressions (or globbing patterns) used in filename globbing with scp2 and sftp2 and in the configuration files ssh2_config and sshd2_config.
Regex syntax used with scp2 and sftp2 is ZSH_FILEGLOB.
The escape character is a backslash (\
). You can use it to escape metacharacters to
use them in their plain character form.
In the following examples, literal E
and F
denote any expression, whether a pattern or a character:
(
Start a capturing
subexpression.
)
End a capturing
subexpression.
E
|F
Disjunction, match either E
or F
(inclusive). E
is preferred if both match.
E*
Act as Kleene star, match E
zero or more times.
E+
Closure, match E
one or
more times.
E?
Option, match E
optionally once.
.
Match any character except
for newline characters (\n
, \f
, \r
) and
the NULL byte.
E{
n
}
Match E
exactly
n
times.
E{
n
,}
or E{
n
,0}
Match E
n
or more times.
E{,
n
}
or
E{0,
n
}
Match E
at most
n
times.
E{
n
,
m
}
Match E
no less than
n
times and no more than
m
times.
[
Start a character set. See
"Character Sets for Egrep and
ZSH_FILEGLOB."
$
Match the empty string at the
end of the input or at the end of a line.
^
Match the empty string at the
start of the input or at the beginning of a line.
The following list describes the tokens:
\0
n
..
n
The literal byte with octal value
n
..
n
.
\0
The NULL byte.
\[1-9]..
x
The literal byte with decimal value [1-9]..
x
.
\x
n
..
n
or\0x
n
..
n
The literal byte with hexadecimal value
n
..
n
.
\<
Match the empty string at the beginning of a word.
\>
Match the empty string at the end of a word.
\b
Match the empty string at a word boundary.
\B
Match the empty string provided it is not at a word boundary.
\w
Match a word-constituent character, equivalent to [a:zA:Z0:9-]
.
\W
Match a non-word-constituent character.
\a
Literal alarm character.
\e
Literal escape character.
\f
Literal line feed.
\n
Literal newline, equivalent to C's \n
so that it can be more than one
character long.
\r
Literal carriage return.
\t
Literal tab.
All other escaped characters denote the literal character itself.