The following table describes the regular expressions that you can use to specify directives:
Table 6-2 Regular expressions
Symbol | Functionality | Usage example | Meaning of the usage example |
---|---|---|---|
. | Indicates one optional character. | a...c | Three optional characters and then character c follow character a. matches with abcdc. |
* | Indicates that the preceding character is repeated for zero or more times. | ab*cd* | Matches with ac, abbbbc, and abbbbcd. |
+ | Indicates that the previous character is repeated for one or more times. | ab*c+ | Matches with abbbc. Does not match with abbb. |
? | Is there a previous character? | abbbc? | Matches with abbbc and abbb. |
| | Denotes the OR operation | a|bc|d | Matches with a, bc, or d. |
![]() | A prefix for a special character (. ^$*+?| ![]() ![]() ![]() | ![]() | Matches with a "." (period). |
![]() | Matches with a single ![]() | ||
^ | Matches at the beginning of a line. | ^ab | Matches with abcde. |
$ | Matches at the end of a line. | abc$ | Matches with aaabc. |
{m} | Indicates repetition of the preceding regular expressions for m number of times. | a{5} | Matches with aaaaa. |
{m,} | Indicates repetition of the preceding regular expressions for minimum m number of times. | a{3,} | Matches with aaa and aaaa. Does not match with aa. |
{m,n} | Repetition of the preceding regular expressions for minimum m and maximum n number of times. | a{3,5} | Matches with aaa, aaaa, and aaaaa. Does not match with aa and aaaaaa. |
[Character string] | Indicates one of the optional characters# included in the character string. | [abc]* or [a-c]* | Matches with aaa, bbb, ccc, cba, and aab. |
[^Character string] | Indicates one of the optional characters that are not included in the character string. | [^0-9] | Matches with one non-numeric character. |
(Character string) | Group the character strings. | (ab)+ | Matches with ababab. Does not Match with ababb. |
aa(xx|yy)bb | Matches with aaxxbb and aayybb. |
In the case of directives that specify directory names, file names, or the path names, the path information that you can specify differs based on the directive type.
The path types are as shown below. Path information of each directive is to be described in the respective directive.
Note that directories and files on the network cannot be specified as path information. Directories and files on a file system that uses the network also cannot be specified.
In the configuration file, if you add a hash mark (#) to the beginning of a line, that line becomes a comment line. However, if you enter a character string that begins with a hash mark (#) after a specified directive, the character string after the hash mark (#) is not commented out. Examples of specifying comment lines are as follows:
#Deny from all
Deny from all #comment
When an IPv6 address is specified in a directive, enclose the IPv6 address in square brackets ([ ]), as in [IPv6-address]. When an IPv6 address and a port number are specified in a directive, enclose the IPv6 address in square brackets ([ ]) and specify the port number after a colon (:), as in [IPv6-address]:port-number.
However, if IPv6 addresses are specified in the following directives, specify the IPv6 addresses without square brackets ([ ]):
Specify a global unicast address when using an IPv6 address.