tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 53387] New: SSI: Allow to use $1 to get result of regular expression matching
Date Fri, 08 Jun 2012 12:14:41 GMT

          Priority: P2
            Bug ID: 53387
           Summary: SSI: Allow to use $1 to get result of regular
                    expression matching
          Severity: enhancement
    Classification: Unclassified
                OS: Windows XP
          Hardware: PC
            Status: NEW
           Version: 7.0.27
         Component: Catalina
           Product: Tomcat 7

This was originally reported in bug 48956, but it is a separate issue.

In Apache HTTPD there is such example in documentation of mod_include: [1]

<!--#if expr="$QUERY_STRING = /^sid=([a-zA-Z0-9]+)/" -->
<!--#set var="session" value="$1" -->
<!--#endif -->


Here $1 references the value of group #1 as caught by regular expression.

Example from comment 3 in bug 48956:
<!--#set var="aux" value="aa12" -->
<!--#if expr="$aux=/^aa([a-zA-Z0-9\-_]*)/" -->
        <!--#set var="aux2" value="$1" -->
<!--#endif -->

Resulting value:<!--#echo var="aux2" -->

In Tomcat support for regular expression in SSI was added in r1136231 and
r1136399 and is implemented in 

Maybe the last used Matcher can be stored in some context, so that it can be
later used to resolve $1 etc. references. I do not know whether $1 is limited
to that #if, or it is available everywhere later until it is overwritten by the
next regexp-matching operation. I do not know how HTTPD behaves here. I think
the latter would be easier to implement.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message