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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Wed Mar 14 07:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     sn@neopoly.com
>Release:        1.3.19
>Organization:
apache
>Environment:
Linux 2.2.17
>Description:
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
extended.
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.
>How-To-Repeat:
Back references example code. Enable mod_include for .shtml pages. Create a page x.shtml with
the following content:

==================8<===============
<BODY>
<!--#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 -->

<P>
<PRE>
<!--#printenv -->
</PRE>
==================8<===============
If you call the page and the HTTP_COOKIE contains "name=John"
you would see test1=John in the printenv output.
>Fix:
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.
>Release-Note:
>Audit-Trail:
>Unformatted:
 [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!     ]
 
 


Mime
View raw message