expr.xml revision 723d1cf47a33d814dc2d980473060e8faf4036a2
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml version="1.0" encoding="UTF-8" ?>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<!-- $LastChangedRevision$ -->
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<!--
b686b6a420bde7f78c416b90be11db94cb789979nd Licensed to the Apache Software Foundation (ASF) under one or more
b686b6a420bde7f78c416b90be11db94cb789979nd contributor license agreements. See the NOTICE file distributed with
b686b6a420bde7f78c416b90be11db94cb789979nd this work for additional information regarding copyright ownership.
b686b6a420bde7f78c416b90be11db94cb789979nd The ASF licenses this file to You under the Apache License, Version 2.0
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (the "License"); you may not use this file except in compliance with
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen the License. You may obtain a copy of the License at
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen http://www.apache.org/licenses/LICENSE-2.0
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd Unless required by applicable law or agreed to in writing, software
b686b6a420bde7f78c416b90be11db94cb789979nd distributed under the License is distributed on an "AS IS" BASIS,
b686b6a420bde7f78c416b90be11db94cb789979nd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3f08db06526d6901aa08c110b5bc7dde6bc39905nd See the License for the specific language governing permissions and
b686b6a420bde7f78c416b90be11db94cb789979nd limitations under the License.
b686b6a420bde7f78c416b90be11db94cb789979nd-->
b686b6a420bde7f78c416b90be11db94cb789979nd
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<manualpage metafile="expr.xml.meta">
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd <title>Expressions in Apache HTTP Server</title>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <summary>
0066eddda7203f6345b56f77d146a759298dc635gryzor <p>Historically, there are several syntax variants for expressions used to express
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd a condition in the different modules of the Apache HTTP Server.
f3ec420152ca921e4c1ce77782f51b53f659018dnd There is some ongoing effort to only use a single variant, called <em>ap_expr</em>,
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung for all configuration directives.
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd This document describes the <em>ap_expr</em> expression parser.
b686b6a420bde7f78c416b90be11db94cb789979nd </p>
b686b6a420bde7f78c416b90be11db94cb789979nd <p>The <em>ap_expr</em> expression is intended to replace most other
b686b6a420bde7f78c416b90be11db94cb789979nd expression variants in HTTPD. For example, the deprecated
b686b6a420bde7f78c416b90be11db94cb789979nd <directive module="mod_ssl">SSLRequire</directive> expressions can be
b686b6a420bde7f78c416b90be11db94cb789979nd replaced by <a href="mod/mod_authz_core.html#reqexpr">Require expr</a>.
b686b6a420bde7f78c416b90be11db94cb789979nd </p>
b686b6a420bde7f78c416b90be11db94cb789979nd </summary>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen<seealso><directive module="core" type="section">If</directive></seealso>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen<seealso><directive module="core" type="section">ElseIf</directive></seealso>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<seealso><directive module="core" type="section">Else</directive></seealso>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<seealso><directive module="mod_rewrite">RewriteCond</directive></seealso>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen<seealso><directive module="mod_setenvif">SetEnvIfExpr</directive></seealso>
b686b6a420bde7f78c416b90be11db94cb789979nd<seealso><directive module="mod_filter">FilterProvider</directive></seealso>
b686b6a420bde7f78c416b90be11db94cb789979nd<seealso><a href="mod/mod_authz_core.html#reqexpr">Require expr</a></seealso>
b686b6a420bde7f78c416b90be11db94cb789979nd<seealso><directive module="mod_ssl">SSLRequire</directive></seealso>
b686b6a420bde7f78c416b90be11db94cb789979nd<seealso><module>mod_include</module></seealso>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <section id="grammar">
b686b6a420bde7f78c416b90be11db94cb789979nd <title>Grammar in Backus–Naur Form notation</title>
b686b6a420bde7f78c416b90be11db94cb789979nd <p><a href="http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form">Backus–Naur Form</a> (BNF) is a notation
b686b6a420bde7f78c416b90be11db94cb789979nd technique for context-free grammars, often used to describe the syntax of languages used in computing.
b686b6a420bde7f78c416b90be11db94cb789979nd </p>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen<blockquote>
b686b6a420bde7f78c416b90be11db94cb789979nd<pre>
b686b6a420bde7f78c416b90be11db94cb789979ndexpr ::= "<strong>true</strong>" | "<strong>false</strong>"
b686b6a420bde7f78c416b90be11db94cb789979nd | "<strong>!</strong>" expr
b686b6a420bde7f78c416b90be11db94cb789979nd | expr "<strong>&amp;&amp;</strong>" expr
b686b6a420bde7f78c416b90be11db94cb789979nd | expr "<strong>||</strong>" expr
b686b6a420bde7f78c416b90be11db94cb789979nd | "<strong>(</strong>" expr "<strong>)</strong>"
b686b6a420bde7f78c416b90be11db94cb789979nd | comp
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndcomp ::= stringcomp
b686b6a420bde7f78c416b90be11db94cb789979nd | integercomp
b686b6a420bde7f78c416b90be11db94cb789979nd | unaryop word
b686b6a420bde7f78c416b90be11db94cb789979nd | word binaryop word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>in</strong>" "<strong>{</strong>" wordlist "<strong>}</strong>"
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen | word "<strong>in</strong>" listfunction
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen | word "<strong>=~</strong>" regex
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf | word "<strong>!~</strong>" regex
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen
e55e60efce8a3e2139132c1d6ad9f6f0d2976614ndstringcomp ::= word "<strong>==</strong>" word
e487d6c09669296f94a5190cc34586a98e624a00nd | word "<strong>!=</strong>" word
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd | word "<strong>&lt;</strong>" word
17ade6df5ec233536985eb1c130a906c725dd614humbedooh | word "<strong>&lt;=</strong>" word
e487d6c09669296f94a5190cc34586a98e624a00nd | word "<strong>&gt;</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>&gt;=</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndintegercomp ::= word "<strong>-eq</strong>" word | word "<strong>eq</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>-ne</strong>" word | word "<strong>ne</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>-lt</strong>" word | word "<strong>lt</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>-le</strong>" word | word "<strong>le</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>-gt</strong>" word | word "<strong>gt</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>-ge</strong>" word | word "<strong>ge</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndwordlist ::= word
b686b6a420bde7f78c416b90be11db94cb789979nd | wordlist "<strong>,</strong>" word
b686b6a420bde7f78c416b90be11db94cb789979nd
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsfword ::= word "<strong>.</strong>" word
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen | digit
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd | "<strong>'</strong>" string "<strong>'</strong>"
e487d6c09669296f94a5190cc34586a98e624a00nd | "<strong>"</strong>" string "<strong>"</strong>"
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd | variable
17ade6df5ec233536985eb1c130a906c725dd614humbedooh | rebackref
e487d6c09669296f94a5190cc34586a98e624a00nd | function
b686b6a420bde7f78c416b90be11db94cb789979nd
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerstring ::= stringpart
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener | string stringpart
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerstringpart ::= cstring
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf | variable
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener | rebackref
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenercstring ::= ...
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsfdigit ::= [0-9]+
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowenvariable ::= "<strong>%{</strong>" varname "<strong>}</strong>"
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen | "<strong>%{</strong>" funcname "<strong>:</strong>" funcargs "<strong>}</strong>"
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowenrebackref ::= "<strong>$</strong>" [0-9]
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndfunction ::= funcname "<strong>(</strong>" word "<strong>)</strong>"
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndlistfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
b686b6a420bde7f78c416b90be11db94cb789979nd</pre>
b686b6a420bde7f78c416b90be11db94cb789979nd</blockquote>
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd</section>
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd<section id="vars">
b686b6a420bde7f78c416b90be11db94cb789979nd <title>Variables</title>
b686b6a420bde7f78c416b90be11db94cb789979nd
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen <p>The expression parser provides a number of variables of the form
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd <code>%{HTTP_HOST}</code>. Note that the value of a variable may depend
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd on the phase of the request processing in which it is evaluated. For
e487d6c09669296f94a5190cc34586a98e624a00nd example, an expression used in an <directive>&lt;If &gt;</directive>
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd directive is evaluated before authentication is done. Therefore,
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <code>%{REMOTE_USER}</code> will not be set in this case.</p>
e487d6c09669296f94a5190cc34586a98e624a00nd
b686b6a420bde7f78c416b90be11db94cb789979nd <p>The following variables provide the values of the named HTTP request
b686b6a420bde7f78c416b90be11db94cb789979nd headers. The values of other headers can be obtained witht the
b686b6a420bde7f78c416b90be11db94cb789979nd <code>req</code> <a href="#functions">function</a>.</p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <table border="1" style="zebra">
0066eddda7203f6345b56f77d146a759298dc635gryzor <columnspec><column width="1"/></columnspec>
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd
f3ec420152ca921e4c1ce77782f51b53f659018dnd <tr><th>Name</th></tr>
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung <tr><td><code>HTTP_ACCEPT</code></td></tr>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd <tr><td><code>HTTP_FORWARDED</code></td></tr>
5effc8b39fae5cd169d17f342bfc265705840014rbowen <tr><td><code>HTTP_HOST</code></td></tr>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen <tr><td><code>HTTP_PROXY_CONNECTION</code></td></tr>
2c9e74eac9f72c14535dd65a520e4de2e664d9cdhumbedooh <tr><td><code>HTTP_REFERER</code></td></tr>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen <tr><td><code>HTTP_USER_AGENT</code></td></tr>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen </table>
b686b6a420bde7f78c416b90be11db94cb789979nd
<p>Other request related variables</p>
<table border="1" style="zebra">
<columnspec><column width=".4"/><column width=".6"/></columnspec>
<tr><th>Name</th><th>Description</th></tr>
<tr><td><code>REQUEST_METHOD</code></td>
<td>The HTTP method of the incoming request (e.g.
<code>GET</code>)</td></tr>
<tr><td><code>REQUEST_SCHEME</code></td>
<td>The scheme part of the request's URI</td></tr>
<tr><td><code>REQUEST_URI</code></td>
<td>The URI of the request</td></tr>
<tr><td><code>DOCUMENT_URI</code></td>
<td>Same as REQUEST_URI</td></tr>
<tr><td><code>REQUEST_FILENAME</code></td>
<td>The full local filesystem path to the file or script matching the
request, if this has already been determined by the server at the
time <code>REQUEST_FILENAME</code> is referenced. Otherwise, such
as when used in virtual host context, the same value as
<code>REQUEST_URI</code> </td></tr>
<tr><td><code>SCRIPT_FILENAME</code></td>
<td>Same as <code>REQUEST_FILENAME</code></td></tr>
<tr><td><code>LAST_MODIFIED</code></td>
<td>The date and time of last modification of the file in the format
<code>20101231235959</code>, if this has already been determined by
the server at the time <code>LAST_MODIFIED</code> is referenced.
</td></tr>
<tr><td><code>SCRIPT_USER</code></td>
<td>The user name of the owner of the script.</td></tr>
<tr><td><code>SCRIPT_GROUP</code></td>
<td>The group name of the group of the script.</td></tr>
<tr><td><code>PATH_INFO</code></td>
<td>The trailing path name information, see
<directive module="core">AcceptPathInfo</directive></td></tr>
<tr><td><code>QUERY_STRING</code></td>
<td>The query string of the current request</td></tr>
<tr><td><code>IS_SUBREQ</code></td>
<td>"<code>true</code>" if the current request is a subrequest,
"<code>false</code>" otherwise</td></tr>
<tr><td><code>THE_REQUEST</code></td>
<td>The complete request line (e.g.,
"<code>GET /index.html HTTP/1.1</code>")</td></tr>
<tr><td><code>REMOTE_ADDR</code></td>
<td>The IP address of the remote host</td></tr>
<tr><td><code>REMOTE_HOST</code></td>
<td>The host name of the remote host</td></tr>
<tr><td><code>REMOTE_USER</code></td>
<td>The name of the authenticated user (if any)</td></tr>
<tr><td><code>REMOTE_IDENT</code></td>
<td>The user name set by <module>mod_ident</module></td></tr>
<tr><td><code>SERVER_NAME</code></td>
<td>The <directive module="core">ServerName</directive> of
the current vhost</td></tr>
<tr><td><code>SERVER_PORT</code></td>
<td>The server port of the current vhost, see
<directive module="core">ServerName</directive></td></tr>
<tr><td><code>SERVER_ADMIN</code></td>
<td>The <directive module="core">ServerAdmin</directive> of
the current vhost</td></tr>
<tr><td><code>SERVER_PROTOCOL</code></td>
<td>The protocol used by the request</td></tr>
<tr><td><code>DOCUMENT_ROOT</code></td>
<td>The <directive module="core">DocumentRoot</directive> of
the current vhost</td></tr>
<tr><td><code>AUTH_TYPE</code></td>
<td>The configured <directive module="mod_authn_core">AuthType</directive>
(e.g. "<code>basic</code>")</td></tr>
<tr><td><code>CONTENT_TYPE</code></td>
<td>The content type of the response</td></tr>
<tr><td><code>HANDLER</code></td>
<td>The name of the <a href="handler.html">handler</a> creating
the response</td></tr>
<tr><td><code>HTTPS</code></td>
<td>"<code>on</code>" if the request uses https,
"<code>off</code>" otherwise</td></tr>
<tr><td><code>IPV6</code></td>
<td>"<code>on</code>" if the connection uses IPv6,
"<code>off</code>" otherwise</td></tr>
<tr><td><code>REQUEST_LOG_ID</code></td>
<td>The error log id of the request (see
<directive module="core">ErrorLogFormat</directive>)</td></tr>
<tr><td><code>CONN_LOG_ID</code></td>
<td>The error log id of the connection (see
<directive module="core">ErrorLogFormat</directive>)</td></tr>
</table>
<p>Misc variables</p>
<table border="1" style="zebra">
<columnspec><column width=".4"/><column width=".6"/></columnspec>
<tr><th>Name</th><th>Description</th></tr>
<tr><td><code>TIME_YEAR</code></td>
<td>The current year (e.g. <code>2010</code>)</td></tr>
<tr><td><code>TIME_MON</code></td>
<td>The current month (<code>1</code>, ..., <code>12</code>)</td></tr>
<tr><td><code>TIME_DAY</code></td>
<td>The current day of the month</td></tr>
<tr><td><code>TIME_HOUR</code></td>
<td>The hour part of the current time
(<code>0</code>, ..., <code>23</code>)</td></tr>
<tr><td><code>TIME_MIN</code></td>
<td>The minute part of the current time </td></tr>
<tr><td><code>TIME_SEC</code></td>
<td>The second part of the current time </td></tr>
<tr><td><code>TIME_WDAY</code></td>
<td>The day of the week (starting with <code>0</code>
for Sunday)</td></tr>
<tr><td><code>TIME</code></td>
<td>The date and time in the format <code>20101231235959</code></td></tr>
<tr><td><code>SERVER_SOFTWARE</code></td>
<td>The server version string</td></tr>
<tr><td><code>API_VERSION</code></td>
<td>The date of the API version (module magic number)</td></tr>
</table>
<p>Some modules register additional variables, see e.g. <module>mod_ssl</module>.</p>
</section>
<section id="binop">
<title>Binary operators</title>
<p>With the exception of some built-in comparison operators, binary
operators have the form "<code>-[a-zA-Z][a-zA-Z0-9_]+</code>", i.e. a
minus and at least two characters. The name is not case sensitive.
Modules may register additional binary operators.</p>
<section id="comp">
<title>Comparison operators</title>
<table border="1" style="zebra">
<columnspec><column width=".2"/><column width=".2"/><column width=".6"/></columnspec>
<tr><th>Name</th><th>Alternative</th> <th>Description</th></tr>
<tr><td><code>==</code></td>
<td><code>=</code></td>
<td>String equality</td></tr>
<tr><td><code>!=</code></td>
<td></td>
<td>String inequality</td></tr>
<tr><td><code>&lt;</code></td>
<td></td>
<td>String less than</td></tr>
<tr><td><code>&lt;=</code></td>
<td></td>
<td>String less than or equal</td></tr>
<tr><td><code>&gt;</code></td>
<td></td>
<td>String greater than</td></tr>
<tr><td><code>&gt;=</code></td>
<td></td>
<td>String greater than or equal</td></tr>
<tr><td><code>-eq</code></td>
<td><code>eq</code></td>
<td>Integer equality</td></tr>
<tr><td><code>-ne</code></td>
<td><code>ne</code></td>
<td>Integer inequality</td></tr>
<tr><td><code>-lt</code></td>
<td><code>lt</code></td>
<td>Integer less than</td></tr>
<tr><td><code>-le</code></td>
<td><code>le</code></td>
<td>Integer less than or equal</td></tr>
<tr><td><code>-gt</code></td>
<td><code>gt</code></td>
<td>Integer greater than</td></tr>
<tr><td><code>-ge</code></td>
<td><code>ge</code></td>
<td>Integer greater than or equal</td></tr>
</table>
</section>
<section id="binaryother">
<title>Other binary operators</title>
<table border="1" style="zebra">
<columnspec><column width=".2"/><column width=".8"/></columnspec>
<tr><th>Name</th><th>Description</th></tr>
<tr><td><code>-ipmatch</code></td>
<td>IP address matches address/netmask</td></tr>
<tr><td><code>-strmatch</code></td>
<td>left string matches pattern given by right string (containing
wildcards *, ?, [])</td></tr>
<tr><td><code>-strcmatch</code></td>
<td>same as <code>-strmatch</code>, but case insensitive</td></tr>
<tr><td><code>-fnmatch</code></td>
<td>same as <code>-strmatch</code>, but slashes are not matched by
wildcards</td></tr>
</table>
</section>
</section>
<section id="unnop">
<title>Unary operators</title>
<p>Unary operators take one argument and have the form
"<code>-[a-zA-Z]</code>", i.e. a minus and one character.
The name <em>is</em> case sensitive.
Modules may register additional unary operators.</p>
<table border="1" style="zebra">
<columnspec><column width=".2"/><column width=".2"/><column width=".6"/></columnspec>
<tr><th>Name</th><th>Description</th><th>Restricted</th></tr>
<tr><td><code>-d</code></td>
<td>The argument is treated as a filename.
True if the file exists and is a directory</td><td>yes</td></tr>
<tr><td><code>-e</code></td>
<td>The argument is treated as a filename.
True if the file (or dir or special) exists</td><td>yes</td></tr>
<tr><td><code>-f</code></td>
<td>The argument is treated as a filename.
True if the file exists and is regular file</td><td>yes</td></tr>
<tr><td><code>-L</code></td>
<td>The argument is treated as a filename.
True if the file exists and is symlink</td><td>yes</td></tr>
<tr><td><code>-h</code></td>
<td>The argument is treated as a filename.
True if the file exists and is symlink
(same as <code>-L</code>)</td><td>yes</td></tr>
<tr><td><code>-F</code></td>
<td>True if string is a valid file, accessible via all the server's
currently-configured access controls for that path. This uses an
internal subrequest to do the check, so use it with care - it can
impact your server's performance!</td><td></td></tr>
<tr><td><code>-U</code></td>
<td>True if string is a valid URL, accessible via all the server's
currently-configured access controls for that path. This uses an
internal subrequest to do the check, so use it with care - it can
impact your server's performance!</td><td></td></tr>
<tr><td><code>-A</code></td>
<td>Alias for <code>-U</code></td><td></td></tr>
<tr><td><code>-n</code></td>
<td>True if string is not empty</td><td></td></tr>
<tr><td><code>-z</code></td>
<td>True if string is empty</td><td></td></tr>
<tr><td><code>-T</code></td>
<td>False if string is empty, "<code>0</code>", "<code>off</code>",
"<code>false</code>", or "<code>no</code>" (case insensitive).
True otherwise.</td><td></td></tr>
<tr><td><code>-R</code></td>
<td>Same as "<code>%{REMOTE_ADDR} -ipmatch ...</code>", but more efficient
</td><td></td></tr>
</table>
<p>The operators marked as "restricted" are not available in some modules
like <module>mod_include</module>.</p>
</section>
<section id="functions">
<title>Functions</title>
<p>Normal string-valued functions take one string as argument and return
a string. Functions names are not case sensitive.
Modules may register additional functions.</p>
<table border="1" style="zebra">
<columnspec><column width=".2"/><column width=".8"/></columnspec>
<tr><th>Name</th><th>Description</th><th>Restricted</th></tr>
<tr><td><code>req</code>, <code>http</code></td>
<td>Get HTTP request header</td><td></td></tr>
<tr><td><code>resp</code></td>
<td>Get HTTP response header</td><td></td></tr>
<tr><td><code>reqenv</code></td>
<td>Lookup request environment variable</td><td></td></tr>
<tr><td><code>osenv</code></td>
<td>Lookup operating system environment variable</td><td></td></tr>
<tr><td><code>note</code></td>
<td>Lookup request note</td><td></td></tr>
<tr><td><code>env</code></td>
<td>Return first match of <code>note</code>, <code>reqenv</code>,
<code>osenv</code></td><td></td></tr>
<tr><td><code>tolower</code></td>
<td>Convert string to lower case</td><td></td></tr>
<tr><td><code>toupper</code></td>
<td>Convert string to uppser case</td><td></td></tr>
<tr><td><code>escape</code></td>
<td>Escape special characters in %hex encoding</td><td></td></tr>
<tr><td><code>unescape</code></td>
<td>Unescape %hex encoded string, leaving URL-special characters
encoded (XXX: describe better)</td><td></td></tr>
<tr><td><code>file</code></td>
<td>Read contents from a file</td><td>yes</td></tr>
<tr><td><code>filesize</code></td>
<td>Return size of a file (or 0 if file does not exist or is not
regular file)</td><td>yes</td></tr>
</table>
<p>The functions marked as "restricted" are not available in some modules
like <module>mod_include</module>.</p>
<p>In addition to string-valued functions, there are also list-valued functions which
take one string as argument and return a wordlist, i.e. a list of strings. The wordlist
can be used with the special <code>-in</code> operator.
Functions names are not case sensitive.
Modules may register additional functions.</p>
<p>There are no built-in list-valued functions. <module>mod_ssl</module>
provides <code>PeerExtList</code>. See the description of
<directive module="mod_ssl">SSLRequire</directive> for details
(but <code>PeerExtList</code> is also usable outside
of <directive module="mod_ssl">SSLRequire</directive>).</p>
</section>
<section id="other">
<title>Other</title>
<table border="1" style="zebra">
<columnspec><column width=".2"/><column width=".2"/><column width=".6"/></columnspec>
<tr><th>Name</th><th>Alternative</th> <th>Description</th></tr>
<tr><td><code>-in</code></td>
<td><code>in</code></td>
<td>string contained in string list</td></tr>
<tr><td><code>/regexp/</code></td>
<td><code>m#regexp#</code></td>
<td>Regular expression (the second form allows different delimiters than /)</td></tr>
<tr><td><code>/regexp/i</code></td>
<td><code>m#regexp#i</code></td>
<td>Case insensitive regular expression</td></tr>
<tr><td><code>$0 ... $9</code></td>
<td></td>
<td>Regular expression backreferences</td></tr>
</table>
<section id="rebackref">
<title>Regular expression backreferences</title>
<p>The strings <code>$0</code> ... <code>$9</code> allow to reference
the capture groups from a previously executed, successfully
matching regular expressions. They can normally only be used in the
same expression as the matching regex, but some modules allow special
uses.</p>
</section>
</section>
</manualpage>