expr.xml revision 723d1cf47a33d814dc2d980473060e8faf4036a2
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<!-- $LastChangedRevision$ -->
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
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.
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>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 </summary>
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 <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.
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen<blockquote>
b686b6a420bde7f78c416b90be11db94cb789979ndexpr ::= "<strong>true</strong>" | "<strong>false</strong>"
b686b6a420bde7f78c416b90be11db94cb789979ndcomp ::= stringcomp
b686b6a420bde7f78c416b90be11db94cb789979nd | integercomp
b686b6a420bde7f78c416b90be11db94cb789979nd | unaryop word
b686b6a420bde7f78c416b90be11db94cb789979nd | word binaryop word
b686b6a420bde7f78c416b90be11db94cb789979nd | word "<strong>in</strong>" "<strong>{</strong>" wordlist "<strong>}</strong>"
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
b686b6a420bde7f78c416b90be11db94cb789979ndwordlist ::= word
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd | variable
e487d6c09669296f94a5190cc34586a98e624a00nd | function
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerstring ::= stringpart
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener | string stringpart
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerstringpart ::= cstring
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf | variable
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener | rebackref
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenercstring ::= ...
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsfdigit ::= [0-9]+
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowenvariable ::= "<strong>%{</strong>" varname "<strong>}</strong>"
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen | "<strong>%{</strong>" funcname "<strong>:</strong>" funcargs "<strong>}</strong>"
b686b6a420bde7f78c416b90be11db94cb789979ndfunction ::= funcname "<strong>(</strong>" word "<strong>)</strong>"
b686b6a420bde7f78c416b90be11db94cb789979ndlistfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
b686b6a420bde7f78c416b90be11db94cb789979nd</blockquote>
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><If ></directive>
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd directive is evaluated before authentication is done. Therefore,
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <code>%{REMOTE_USER}</code> will not be set in this case.</p>
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
take one string as argument and return a wordlist, i.e. a list of strings. The wordlist