www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Neuhaus ...@neopoly.com>
Subject mod_include/7412: regular expressions do not support back references
Date Wed, 14 Mar 2001 15:01:35 GMT

>Number:         7412
>Category:       mod_include
>Synopsis:       regular expressions do not support back references
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Wed Mar 14 07:10:01 PST 2001
>Originator:     sn@neopoly.com
>Release:        1.3.19
Linux 2.2.17
The documentation for mod_include states:
Regular expressions have the same syntax as those found in the Unix egrep command.

However, in the gnu egrep manpage, there are two flavors of regular expressions: basic and
I would love to see back references supported in Apache 1.x, this would make mod_include a
lot more powerful. Using brackets you could match the information you are looking for and
then set a variable with the the part of the string you matched.
Back references example code. Enable mod_include for .shtml pages. Create a page x.shtml with
the following content:

<!--#if expr="'$HTTP_COOKIE' = '/name=(.*)/'"-->
name found in cookie!
<!--#set var="test1" value="\1" -->
<!--#set var="test2" value="$1" -->
<!--#else -->
no name found in cookie!
<!--#endif -->

<!--#printenv -->
If you call the page and the HTTP_COOKIE contains "name=John"
you would see test1=John in the printenv output.
If back references would work in the above example, mod_include could be used to extract and
display information from all the environment variables (QUERY_STRING, HTTP_COOKIE etc) without
a need for mod_perl, php etc.
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message