You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/06/08 14:14:41 UTC
[Bug 53387] New: SSI: Allow to use $1 to get result of regular
expression matching
https://issues.apache.org/bugzilla/show_bug.cgi?id=53387
Priority: P2
Bug ID: 53387
Assignee: dev@tomcat.apache.org
Summary: SSI: Allow to use $1 to get result of regular
expression matching
Severity: enhancement
Classification: Unclassified
OS: Windows XP
Reporter: knst.kolinko@gmail.com
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 -->
]]]
[1] http://httpd.apache.org/docs/current/mod/mod_include.html
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
ExpressionParseTree$CompareNode#compareBranches()
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 53387] SSI: Allow to use $1 to get result of regular expression
matching
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53387
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |david.reitter@gmail.com
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
*** Bug 55176 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org