It's not RegEx as such, it's mod_include.
Could be, and you are likely correct. I didn't pull the source to examine and confirm but I'm guessing mod_include probably knew it needed some type of indicator that it should invoke the regular expression engine and so it decided to use the default delimiter and the only way it would know where the pattern begins and ends is to locate the ending delimiter. Then the only way to use the delimiter within the pattern then is to escape it. This is quite common and you'll notice it invoked in all kinds of programming languages and APIs for those languages.
Good catch on that note on the Apache docs regarding escaping slashes. That solidified it. I prefer the text man page for PCRE:
[
pcre.org...]
A bit more primitive but I'm quite accustomed to the format. Perl does a great job on the perldocs too though. I agree, that Perl 5 link should be pulled or changed.
At the same time it's clear from their own examples that / doesn't have to mean "we are now entering Regular Expressions mode". There are tons of this kind of thing:
<!--#if expr='"$DOCUMENT_URI" = "/foo/file.html"' -->
Actually, yes it still does mean that you are going to enter PCRE mode. The pattern you show here and in the examples to which you refer are not starting with a slash but they start with a double quotation mark. Easy to miss at first glance, but it is indeed there. Take a look at the second half of the comparison expression as it does not start with a slash but a double quotation mark:
"/foo/file.html"
... which in turn ends up in the expression being tested as a string comparison returning boolean true or false.
The REQUEST_URI is always going to start with a directory separator. It's root-relative. However, it may or may not be present too, depending on the http server and server configuration. I believe it was introduced originally with Apache and mod_rewrite but I cannot recall. It is an extension to the CGI standard. I would expect it to be there myself but in the event it does not work perhaps one of the other variables should be used, particularly DOCUMENT_URI, because that would always be available when using mod_include.
If you are curious about other CGI variables, the Apache documentation for CGI has some environment variables listed in the provisions area and then a link to the CGI spec where the other variables are listed. You can also pull the RFC on CGI. I listed some resources below.
on a completely off-topic note, I linked to the Apache 2.2 docs earlier in this thread and should really be linking to the trunk documentation because the links to the CGI spec on the earlier Apache docs are now gone; updated documentation is always available on the Apache trunk docs mod_cgi: [
httpd.apache.org...]
RFC: [
ietf.org...]
Apache environment variables: [
httpd.apache.org...]
mod_rewrite: [
httpd.apache.org...]