import java.text.ParseException;
import java.util.LinkedList;
import java.util.List;
+import java.util.regex.Pattern;
/**
* Represents a parsed expression.
*
protected int compareBranches() {
String val1 = ((StringNode)left).getValue();
String val2 = ((StringNode)right).getValue();
+
+ int val2Len = val2.length();
+ if (val2Len > 1 && val2.charAt(0) == '/' &&
+ val2.charAt(val2Len - 1) == '/') {
+ // Treat as a regular expression
+ String expr = val2.substring(1, val2Len - 1);
+ Pattern pattern = Pattern.compile(expr);
+ // Regular expressions will only ever be used with EqualNode
+ // so return zero for equal and non-zero for not equal
+ if (pattern.matcher(val1).find()) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
return val1.compareTo(val2);
}
}
<subsection name="Catalina">
<changelog>
<add>
+ <bug>48956</bug>: Add regular expression support for SSI. (markt)
+ </add>
+ <add>
<bug>50677</bug>: Allow system property variables to be used in the
values of "common.loader" and other "*.loader" properties in the
<code>catalina.properties</code> file. (kkolinko)